diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index da018cf..b0d4191 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -10,7 +10,7 @@ from colorfield.fields import ColorField from django_ckeditor_5.fields import CKEditor5Field from urllib.parse import urlparse from django.core.cache import cache -from django.contrib.auth.models import User +from django.contrib.auth.models import User, AnonymousUser import emoji import hashlib @@ -935,7 +935,10 @@ class Event(models.Model): self.no_modification_date_changed = True def set_processing_user(self, user): - self.processing_user = user + if user.is_anonymous: + self.processing_user = None + else: + self.processing_user = user def set_in_moderation_process(self): self.in_moderation_process = True