This commit is contained in:
Peter Bassem Sobhi 2022-03-02 17:33:17 -08:00 committed by GitHub
commit d3930973d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,8 @@ class LoginSerializer(serializers.Serializer):
# Did we get back an active user?
if user:
if not user.is_active:
# Raises error only if user is deactivated and inactive user login is disabled
if not user.is_active and not getattr(settings, 'REST_INACTIVE_USER_LOGIN', False):
msg = _('User account is disabled.')
raise exceptions.ValidationError(msg)
else: