Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Made modwsgi groups_for_user consistent with check_password

2b5f848 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
  • Loading branch information...
commit 0e18fb04bad99de237b5eb8ea4f9ff2f3cd147d3 1 parent 718afca
Preston Holmes authored February 09, 2013

Showing 1 changed file with 1 addition and 5 deletions. Show diff stats Hide diff stats

  1. 6  django/contrib/auth/handlers/modwsgi.py
6  django/contrib/auth/handlers/modwsgi.py
@@ -40,11 +40,7 @@ def groups_for_user(environ, username):
40 40
             user = UserModel._default_manager.get_by_natural_key(username)
41 41
         except UserModel.DoesNotExist:
42 42
             return []
43  
-        try:
44  
-            if not user.is_active:
45  
-                return []
46  
-        except AttributeError as e:
47  
-            # a custom user may not support is_active
  43
+        if not user.is_active:
48 44
             return []
49 45
         return [force_bytes(group.name) for group in user.groups.all()]
50 46
     finally:

0 notes on commit 0e18fb0

Please sign in to comment.
Something went wrong with that request. Please try again.