diff --git a/cash/views.py b/cash/views.py index 4fa7a72..7e9885a 100644 --- a/cash/views.py +++ b/cash/views.py @@ -78,13 +78,17 @@ class UserSettingsForm(forms.Form): class UserPinForm(forms.Form): pin = forms.CharField(max_length=32, widget=forms.PasswordInput, - label=ugettext_lazy('PIN')) + label=ugettext_lazy('PIN'), required=False) pin_confirm = forms.CharField(max_length=32, widget=forms.PasswordInput, - label=ugettext_lazy('PIN (confirmation)')) + label=ugettext_lazy('PIN (confirmation)'), + required=False) def clean(self): cleaned_data = super(UserPinForm, self).clean() - + + if not (cleaned_data.has_key('pin') or + cleaned_data.has_key('pin_confirm')): + return cleaned_data if cleaned_data['pin'] != cleaned_data['pin_confirm']: raise forms.ValidationError(_('PINs do not match.')) @@ -126,3 +130,5 @@ def usersettings(request, submit=None): + +