Correction création par fusion

Fix #218
This commit is contained in:
Jean-Marie Favreau 2024-11-27 12:20:27 +01:00
parent d7ec80ff01
commit 1287d9ee06
2 changed files with 4 additions and 1 deletions

View File

@ -484,7 +484,7 @@ class SelectEventInList(Form):
class MergeDuplicates(Form): class MergeDuplicates(Form):
required_css_class = 'required' required_css_class = 'required'
checkboxes_fields = ["reference_urls", "description"] checkboxes_fields = ["reference_urls", "description", "tags"]
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.duplicates = kwargs.pop("duplicates", None) self.duplicates = kwargs.pop("duplicates", None)

View File

@ -1307,11 +1307,14 @@ def merge_duplicate(request, pk):
new_event_data["local_image"] = getattr(selected, "local_image") new_event_data["local_image"] = getattr(selected, "local_image")
organisers = new_event_data.pop('organisers', None)
# create a new event that merge the selected events # create a new event that merge the selected events
new_event = Event(**new_event_data) new_event = Event(**new_event_data)
new_event.status = Event.STATUS.PUBLISHED new_event.status = Event.STATUS.PUBLISHED
new_event.other_versions = edup new_event.other_versions = edup
new_event.save() new_event.save()
if not organisers is None:
new_event.organisers.set(organisers.all())
edup.fix(new_event) edup.fix(new_event)
messages.info(request, _("Creation of a merged event has been successfully completed.")) messages.info(request, _("Creation of a merged event has been successfully completed."))