diff --git a/django/contrib/auth/handlers/modwsgi.py b/django/contrib/auth/handlers/modwsgi.py index a26d6219dd9..df20f1283af 100644 --- a/django/contrib/auth/handlers/modwsgi.py +++ b/django/contrib/auth/handlers/modwsgi.py @@ -40,11 +40,7 @@ def groups_for_user(environ, username): user = UserModel._default_manager.get_by_natural_key(username) except UserModel.DoesNotExist: return [] - try: - if not user.is_active: - return [] - except AttributeError as e: - # a custom user may not support is_active + if not user.is_active: return [] return [force_bytes(group.name) for group in user.groups.all()] finally: