quand on créé une copie locale, elle est modérée en même temps
Fix #252
This commit is contained in:
parent
359451b9f8
commit
7c9d930e6f
@ -189,6 +189,7 @@ class EventForm(GroupFormMixin, ModelForm):
|
|||||||
|
|
||||||
old_local_image = CharField(widget=HiddenInput(), required=False)
|
old_local_image = CharField(widget=HiddenInput(), required=False)
|
||||||
simple_cloning = CharField(widget=HiddenInput(), required=False)
|
simple_cloning = CharField(widget=HiddenInput(), required=False)
|
||||||
|
cloning = CharField(widget=HiddenInput(), required=False)
|
||||||
|
|
||||||
tags = MultipleChoiceField(
|
tags = MultipleChoiceField(
|
||||||
label=_("Tags"),
|
label=_("Tags"),
|
||||||
|
@ -81,7 +81,7 @@ Duplication de {% else %}
|
|||||||
{{ form }}
|
{{ form }}
|
||||||
<div class="grid buttons stick-bottom">
|
<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>
|
<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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
@ -339,6 +339,7 @@ class EventUpdateView(
|
|||||||
obj.save()
|
obj.save()
|
||||||
result["other_versions"] = obj.other_versions
|
result["other_versions"] = obj.other_versions
|
||||||
result["status"] = Event.STATUS.PUBLISHED
|
result["status"] = Event.STATUS.PUBLISHED
|
||||||
|
result["cloning"] = True
|
||||||
|
|
||||||
if self.is_simple_cloning:
|
if self.is_simple_cloning:
|
||||||
result["other_versions"] = None
|
result["other_versions"] = None
|
||||||
@ -582,6 +583,9 @@ class EventCreateView(SuccessMessageMixin, CreateView):
|
|||||||
if form.cleaned_data['simple_cloning']:
|
if form.cleaned_data['simple_cloning']:
|
||||||
form.instance.set_skip_duplicate_check()
|
form.instance.set_skip_duplicate_check()
|
||||||
|
|
||||||
|
if form.cleaned_data['cloning']:
|
||||||
|
form.instance.set_in_moderation_process()
|
||||||
|
|
||||||
form.instance.import_sources = None
|
form.instance.import_sources = None
|
||||||
form.instance.set_processing_user(self.request.user)
|
form.instance.set_processing_user(self.request.user)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user