| 49 | |
| 50 | def full_clean(self): |
| 51 | super().full_clean() |
| 52 | new_pin = self.data.get('new_pin') |
| 53 | new_pin_confirm = self.data.get('new_pin_confirm') |
| 54 | |
| 55 | if new_pin or new_pin_confirm: |
| 56 | if new_pin != new_pin_confirm: |
| 57 | self.add_error('new_pin_confirm', _('PIN codes do not match.')) |
| 58 | |
| 59 | class AccountForm(forms.Form): |
| 60 | email = forms.EmailField(label=_("Email"), widget=forms.EmailInput(), max_length=254) |
| 61 | notifications = forms.BooleanField(label=_("Notifications"), widget=forms.CheckboxInput(), required=False) |
| 62 | units_imperial = forms.BooleanField(label=_("Imperial Units"), widget=forms.CheckboxInput(), required=False) |
| 63 | timezone = forms.ChoiceField(label=_("Timezone"), choices=TIMEZONE_CHOICES, required=False) |
| 64 | |
| 65 | class ProbeConfigForm(forms.Form): |
| 66 | new_config_id = forms.IntegerField(label="New Config ID", required=False) |
| 67 | request = forms.CharField(widget=forms.HiddenInput(), required=True) |
| 68 | |
| 69 | |
| 70 | class SignUpForm(UserCreationForm): |
| 71 | email = forms.EmailField(widget=forms.EmailInput(), max_length=254) |
| 72 | timezone = forms.CharField( |
| 73 | required=False, |
| 74 | max_length=32, |