mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-12-22 23:42:25 +00:00
Fix anonymous users issue
This commit is contained in:
parent
5b995f16f1
commit
09137dd9d7
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user