Skip to content
Snippets Groups Projects
Commit 09137dd9 authored by ynerant's avatar ynerant
Browse files

Fix anonymous users issue

parent 5b995f16
No related branches found
No related tags found
1 merge request!35Fix anonymous users issue
Pipeline #7845 passed with warnings with stages
in 4 minutes and 3 seconds
...@@ -78,6 +78,10 @@ def save_object(sender, instance, **kwargs): ...@@ -78,6 +78,10 @@ def save_object(sender, instance, **kwargs):
user, ip = get_user_and_ip(sender) user, ip = get_user_and_ip(sender)
from django.contrib.auth.models import AnonymousUser
if isinstance(user, AnonymousUser):
user = None
if user is not None and instance._meta.label_lower == "auth.user" and previous: if user is not None and instance._meta.label_lower == "auth.user" and previous:
# Don't save last login modifications # Don't save last login modifications
if instance.last_login != previous.last_login: if instance.last_login != previous.last_login:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment