Skip to content

Commit

Permalink
fix: set default value to None for request.user
Browse files Browse the repository at this point in the history
  • Loading branch information
aqeelat committed Jan 4, 2023
1 parent f164bdb commit 9c7b732
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion auditlog/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _get_remote_addr(request):

@staticmethod
def _get_actor(request):
user = getattr(request, "user")
user = getattr(request, "user", None)
if isinstance(user, get_user_model()) and user.is_authenticated:
return user
return None
Expand Down

0 comments on commit 9c7b732

Please sign in to comment.