Skip to content

Commit 0aa77b9

Browse files
committed
fixup!: try again
1 parent e718bcc commit 0aa77b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kobo/apps/audit_log/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def create_access_log_for_request(request, user=None, authentication_type: str =
8080
# django-loginas will keep the superuser as the _cached_user while request.user is set to the new one
8181
# sometimes there won't be a cached user at all, mostly in tests
8282
initial_user = request._cached_user if hasattr(request, '_cached_user') else None
83-
is_loginas_url = hasattr(request, 'resolver_match') and request.resolver_match.url_name == 'loginas-user-login'
83+
is_loginas_url = request.resolver_match is not None and request.resolver_match.url_name == 'loginas-user-login'
8484
# a regular login may have an anonymous user as _cached_user, ignore that
8585
user_changed = initial_user and initial_user.is_authenticated and initial_user.id != logged_in_user.id
8686
is_loginas = is_loginas_url and user_changed

0 commit comments

Comments
 (0)