Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
voy committed Mar 17, 2011
1 parent 43c11e3 commit 74028f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 7 additions & 3 deletions enroll/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __new__(cls, name, bases, attrs):
add_validators_to_class_fields(new_class)
return new_class


class ExplicitValidationFormMetaclass(DeclarativeFieldsMetaclass):
"""Adds explicit declared field validators to class fields"""
def __new__(cls, name, bases, attrs):
Expand All @@ -49,6 +50,7 @@ def __init__(self, *args, **kwargs):
super(RequestAcceptingModelForm, self).__init__(*args, **kwargs)
self.request = request


class RequestAcceptingForm(forms.Form):
"""Helper class. Store request on form instance."""

Expand Down Expand Up @@ -121,8 +123,9 @@ def clean_password_couple(self):


class SignUpForm(PasswordFormMixin, BaseSignUpForm):
password1 = forms.CharField(required=True, widget=forms.PasswordInput, label=_(u'password'), min_length=getattr(settings , 'ENROLL_PASSWORD_MIN_LENGTH', 4))
password2 = forms.CharField(required=True, widget=forms.PasswordInput, label=_(u'password (again)'))
password1 = forms.CharField(required=True, widget=forms.PasswordInput, label=_(u'password'),
min_length=getattr(settings , 'ENROLL_PASSWORD_MIN_LENGTH', 4))
password2 = forms.CharField(required=True, widget=forms.PasswordInput, label=_(u'password (again)'), )

def clean(self):
self.clean_password_couple()
Expand Down Expand Up @@ -195,4 +198,5 @@ def clean(self):
def save(self):
self.user.set_password(self.cleaned_data['password1'])
self.user.save()
return self.user
return self.user

2 changes: 0 additions & 2 deletions enroll/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,3 @@ def __call__(self, password):
self.validate_sequnce(password, self.DIGIT_SEQUENCE, _(u'Password cannot be ascending or descending sequence.'))
self.validate_sequnce(password, getattr(settings , 'ENROLL_FORBIDDEN_PASSWORDS', []), _(u'Password is not allowed.'))



0 comments on commit 74028f2

Please sign in to comment.