diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index 2405841..4c87da6 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -1612,7 +1612,9 @@ class Event(models.Model): for e in to_import: if e.is_event_long_duration(): e.status = Event.STATUS.DRAFT - e.set_message(_("The duration of the event is a little too long for direct publication. Moderators can choose to publish it or not.")) + e.set_message( + Message(subject=_('Import'), name=_('import process'), message=_("The duration of the event is a little too long for direct publication. Moderators can choose to publish it or not.")) + ) # then import all the new events imported = Event.objects.bulk_create(to_import) @@ -1621,7 +1623,8 @@ class Event(models.Model): if ti.has_pending_organisers() and ti.pending_organisers is not None: i.organisers.set(ti.pending_organisers) if ti.has_message(): - msg = Message(subject=_('Import'), related_event=i, name=_('import process'), message=ti.get_message()) + msg = ti.get_message() + msg.related_event = i msg.save() nb_updated = Event.objects.bulk_update(