forms: Remove unnecessary OurAuthenticationForm logic.

This is checked for in the caller of OurAuthenticationForm, which
meant this code was never run.  But it is worth having an assertion
here to catch any possible regressions.
This commit is contained in:
Tim Abbott
2017-11-17 17:23:03 -08:00
committed by Greg Price
parent 719d6c49df
commit f6e57fd514

View File

@@ -264,13 +264,9 @@ class OurAuthenticationForm(AuthenticationForm):
return_data = {} # type: Dict[str, Any]
self.user_cache = authenticate(self.request, username=username, password=password,
realm=realm, return_data=return_data)
if return_data.get("inactive_realm"):
error_msg = (u"""Sorry for the trouble, but %s has been deactivated.
Please contact %s to reactivate this group.""" % (
realm.name,
FromAddress.SUPPORT))
raise ValidationError(mark_safe(error_msg))
if return_data.get("inactive_realm"):
raise AssertionError("Programming error: inactive realm in authentication form")
if return_data.get("inactive_user") and not return_data.get("is_mirror_dummy"):
# We exclude mirror dummy accounts here. They should be treated as the