From 0e18fb04bad99de237b5eb8ea4f9ff2f3cd147d3 Mon Sep 17 00:00:00 2001
From: Preston Holmes <preston@ptone.com>
Date: Sat, 9 Feb 2013 09:30:26 -0800
Subject: [PATCH] Made modwsgi groups_for_user consistent with check_password

2b5f848207b1dab35afd6f63d0107629c76d4d9a based its changes on #19061
that made the is_active attribute mandatory for user models.
The try/except was not removed for the groups_for_user function.

refs #19780
---
 django/contrib/auth/handlers/modwsgi.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/django/contrib/auth/handlers/modwsgi.py b/django/contrib/auth/handlers/modwsgi.py
index a26d6219dd..df20f1283a 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: