✅(backend) handle inactive user
Handle case where user is inactive. Previously this edge case would cause unexpected behavior. Related to previous commit that added the test coverage.
This commit is contained in:
committed by
aleb_the_flash
parent
eeb71f90bc
commit
04d76acce5
@@ -83,4 +83,10 @@ class OIDCAuthenticationBackend(MozillaOIDCAuthenticationBackend):
|
||||
else:
|
||||
user = None
|
||||
|
||||
if not user:
|
||||
return None
|
||||
|
||||
if not user.is_active:
|
||||
raise SuspiciousOperation(_("User account is disabled"))
|
||||
|
||||
return user
|
||||
|
||||
Reference in New Issue
Block a user