From 0e4350da32ae2da949dda650f87a7144cb66f13f Mon Sep 17 00:00:00 2001 From: Sam Morgan Date: Mon, 5 Feb 2024 15:32:47 -0800 Subject: [PATCH] Make REMOTE_ADDR optional Resolves #263 --- easyaudit/signals/auth_signals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easyaudit/signals/auth_signals.py b/easyaudit/signals/auth_signals.py index 4c79c7c..ca3676b 100644 --- a/easyaudit/signals/auth_signals.py +++ b/easyaudit/signals/auth_signals.py @@ -18,7 +18,7 @@ def user_logged_in(sender, request, user, **kwargs): 'login_type': LoginEvent.LOGIN, '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: if should_propagate_exceptions():