diff --git a/src/agenda_culturel/forms.py b/src/agenda_culturel/forms.py index d6d58ea..fe100fc 100644 --- a/src/agenda_culturel/forms.py +++ b/src/agenda_culturel/forms.py @@ -189,6 +189,7 @@ class EventForm(GroupFormMixin, ModelForm): old_local_image = CharField(widget=HiddenInput(), required=False) simple_cloning = CharField(widget=HiddenInput(), required=False) + cloning = CharField(widget=HiddenInput(), required=False) tags = MultipleChoiceField( label=_("Tags"), diff --git a/src/agenda_culturel/templates/agenda_culturel/event_form.html b/src/agenda_culturel/templates/agenda_culturel/event_form.html index fbc1128..dfe2649 100644 --- a/src/agenda_culturel/templates/agenda_culturel/event_form.html +++ b/src/agenda_culturel/templates/agenda_culturel/event_form.html @@ -81,7 +81,7 @@ Duplication de {% else %} {{ form }}
Annuler - +
diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 2907b38..df70345 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -320,7 +320,7 @@ class EventUpdateView( kwargs["is_simple_cloning"] = self.is_simple_cloning return kwargs - def form_valid(self, form): + def form_valid(self, form): form.instance.set_processing_user(self.request.user) return super().form_valid(form) @@ -339,6 +339,7 @@ class EventUpdateView( obj.save() result["other_versions"] = obj.other_versions result["status"] = Event.STATUS.PUBLISHED + result["cloning"] = True if self.is_simple_cloning: result["other_versions"] = None @@ -581,6 +582,9 @@ class EventCreateView(SuccessMessageMixin, CreateView): if form.cleaned_data['simple_cloning']: form.instance.set_skip_duplicate_check() + + if form.cleaned_data['cloning']: + form.instance.set_in_moderation_process() form.instance.import_sources = None form.instance.set_processing_user(self.request.user)