1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-30 04:13:01 +00:00

Merge branch 'fix_signin' into 'master'

Fix anonymous users issue

See merge request bde/nk20!35
This commit is contained in:
Pierre-antoine Comby 2020-03-07 17:37:04 +01:00
commit 70c9c3254f

View File

@ -78,6 +78,10 @@ def save_object(sender, instance, **kwargs):
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:
# Don't save last login modifications
if instance.last_login != previous.last_login: