quand on créé une copie locale, elle est modérée en même temps

Fix #252
This commit is contained in:
Jean-Marie Favreau 2024-12-22 16:08:58 +01:00
parent 359451b9f8
commit 7c9d930e6f
3 changed files with 7 additions and 2 deletions

View File

@ -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"),

View File

@ -81,7 +81,7 @@ Duplication de {% else %}
{{ form }}
<div class="grid buttons stick-bottom">
<a href="{% if request.META.HTTP_REFERER %}{{ request.META.HTTP_REFERER }}{% else %}{{ object.get_absolute_url }}{% endif %}" role="button" class="secondary">Annuler</a>
<input type="submit" value="Enregistrer">
<input type="submit" value="Enregistrer{% if form.is_clone_from_url %} et modérer{% endif %}">
</div>
</form>

View File

@ -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
@ -582,6 +583,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)