On reset le cache en cas d'ajout d'un nouveau tag
This commit is contained in:
@@ -441,6 +441,8 @@ class EventForm(GroupFormMixin, ModelForm):
|
|||||||
|
|
||||||
if self.is_moderation_expert and self.cleaned_data.get("new_tags") is not None:
|
if self.is_moderation_expert and self.cleaned_data.get("new_tags") is not None:
|
||||||
self.cleaned_data["tags"] += self.cleaned_data.get("new_tags")
|
self.cleaned_data["tags"] += self.cleaned_data.get("new_tags")
|
||||||
|
# if a new tag is introduced, we clean the corresponding cache
|
||||||
|
Tag.clear_cache()
|
||||||
|
|
||||||
# when cloning an existing event, we need to copy the local image
|
# when cloning an existing event, we need to copy the local image
|
||||||
if (
|
if (
|
||||||
@@ -517,6 +519,8 @@ class EventModerateForm(ModelForm):
|
|||||||
|
|
||||||
if self.is_moderation_expert and self.cleaned_data.get("new_tags") is not None:
|
if self.is_moderation_expert and self.cleaned_data.get("new_tags") is not None:
|
||||||
self.cleaned_data["tags"] += self.cleaned_data.get("new_tags")
|
self.cleaned_data["tags"] += self.cleaned_data.get("new_tags")
|
||||||
|
# if a new tag is introduced, we clean the corresponding cache
|
||||||
|
Tag.clear_cache()
|
||||||
|
|
||||||
self.cleaned_data["tags"] = list(set(self.cleaned_data["tags"]))
|
self.cleaned_data["tags"] = list(set(self.cleaned_data["tags"]))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user