Commit 0e18fb04 authored by Preston Holmes's avatar Preston Holmes
Browse files

Made modwsgi groups_for_user consistent with check_password

2b5f8482 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
parent 718afcaf
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -40,12 +40,8 @@ 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
            return []
        return [force_bytes(group.name) for group in user.groups.all()]
    finally:
        db.close_connection()