Superusers bypass approval check

This should fix the remainder of the tests
This commit is contained in:
2020-01-11 19:15:02 +00:00
parent b7d1d86486
commit 4d722fd5cb

View File

@@ -57,7 +57,7 @@ class ProfileChangeForm(UserChangeForm):
class CheckApprovedForm(AuthenticationForm):
def confirm_login_allowed(self, user):
if not user.is_approved:
if not user.is_approved and not user.is_superuser:
raise forms.ValidationError("Your account hasn't been approved by an administrator yet. Please check back in a few minutes!")
return AuthenticationForm.confirm_login_allowed(self, user)