|
|
@@ -145,21 +145,21 @@ class OrganizationAuthenticationForm(Form):
|
|
|
return self.cleaned_data
|
|
|
|
|
|
def confirm_login_allowed(self, user):
|
|
|
- """
|
|
|
- Controls whether the given User may log in. This is a policy setting,
|
|
|
- independent of end-user authentication. This default behavior is to
|
|
|
- allow login by active users, and reject login by inactive users.
|
|
|
+ """
|
|
|
+ Controls whether the given User may log in. This is a policy setting,
|
|
|
+ independent of end-user authentication. This default behavior is to
|
|
|
+ allow login by active users, and reject login by inactive users.
|
|
|
|
|
|
- If the given user cannot log in, this method should raise a
|
|
|
- ``forms.ValidationError``.
|
|
|
+ If the given user cannot log in, this method should raise a
|
|
|
+ ``forms.ValidationError``.
|
|
|
|
|
|
- If the given user may log in, this method should return None.
|
|
|
- """
|
|
|
- if not user.is_active:
|
|
|
- raise ValidationError(
|
|
|
- self.error_messages['inactive'],
|
|
|
- code='inactive',
|
|
|
- )
|
|
|
+ If the given user may log in, this method should return None.
|
|
|
+ """
|
|
|
+ if not user.is_active:
|
|
|
+ raise ValidationError(
|
|
|
+ self.error_messages['inactive'],
|
|
|
+ code='inactive',
|
|
|
+ )
|
|
|
|
|
|
def get_user(self):
|
|
|
return self.user_cache
|