Skip to content

Commit

Permalink
Merge remote-tracking branch 'soynatan/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
samamorgan committed Mar 18, 2024
2 parents 58171ae + c2aa54c commit c0d8bd7
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 152 deletions.
4 changes: 2 additions & 2 deletions easyaudit/signals/auth_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def user_logged_out(sender, request, user, **kwargs):
"login_type": LoginEvent.LOGOUT,
"username": getattr(user, user.USERNAME_FIELD),
"user_id": getattr(user, "id", None),
"remote_ip": request.META[REMOTE_ADDR_HEADER],
"remote_ip": request.META.get(REMOTE_ADDR_HEADER, ""),
}
)
except Exception:
Expand All @@ -56,7 +56,7 @@ def user_login_failed(sender, credentials, **kwargs):
{
"login_type": LoginEvent.FAILED,
"username": credentials[user_model.USERNAME_FIELD],
"remote_ip": request.META[REMOTE_ADDR_HEADER],
"remote_ip": request.META.get(REMOTE_ADDR_HEADER, ""),
}
)
except Exception:
Expand Down
Loading

0 comments on commit c0d8bd7

Please sign in to comment.