diff options
| author | Preston Holmes <preston@ptone.com> | 2013-02-09 09:30:26 -0800 |
|---|---|---|
| committer | Preston Holmes <preston@ptone.com> | 2013-02-09 09:33:34 -0800 |
| commit | bb12ea2cf1cb0e093bd35886398e0f27d49fcde8 (patch) | |
| tree | 38d56626b0d255f3319b151a1e398955ba54328f | |
| parent | 7b278278ab66ddaba85b1a0604d6764005d29c70 (diff) | |
[1.5.x] 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
| -rw-r--r-- | django/contrib/auth/handlers/modwsgi.py | 6 |
1 files changed, 1 insertions, 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: |
