Raffinement de la gestion des messages

This commit is contained in:
Jean-Marie Favreau 2024-12-29 17:16:20 +01:00
parent fc86738ee3
commit 7f9ad5dd1b
6 changed files with 150 additions and 115 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: agenda_culturel\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-29 13:06+0100\n"
"POT-Creation-Date: 2024-12-29 16:31+0100\n"
"PO-Revision-Date: 2023-10-29 14:16+0000\n"
"Last-Translator: Jean-Marie Favreau <jeanmarie.favreau@free.fr>\n"
"Language-Team: Jean-Marie Favreau <jeanmarie.favreau@free.fr>\n"
@ -111,11 +111,11 @@ msgid "Imported from"
msgstr "Importé depuis"
#: agenda_culturel/filters.py:366 agenda_culturel/models.py:622
#: agenda_culturel/models.py:2151
#: agenda_culturel/models.py:2153
msgid "Status"
msgstr "Status"
#: agenda_culturel/filters.py:367 agenda_culturel/models.py:1941
#: agenda_culturel/filters.py:367 agenda_culturel/models.py:1943
msgid "Closed"
msgstr "Fermé"
@ -124,7 +124,7 @@ msgid "Open"
msgstr "Ouvert"
#: agenda_culturel/filters.py:371 agenda_culturel/filters.py:372
#: agenda_culturel/models.py:1935
#: agenda_culturel/models.py:1937
msgid "Spam"
msgstr "Spam"
@ -132,7 +132,7 @@ msgstr "Spam"
msgid "Non spam"
msgstr "Non spam"
#: agenda_culturel/filters.py:377 agenda_culturel/models.py:1956
#: agenda_culturel/filters.py:377 agenda_culturel/models.py:1958
msgid "Type"
msgstr "Type"
@ -159,11 +159,11 @@ msgstr ""
msgid "Your email"
msgstr "Votre adresse email"
#: agenda_culturel/forms.py:135 agenda_culturel/models.py:1925
#: agenda_culturel/forms.py:135 agenda_culturel/models.py:1927
msgid "Your email address"
msgstr "Votre adresse email"
#: agenda_culturel/forms.py:141 agenda_culturel/models.py:1948
#: agenda_culturel/forms.py:141 agenda_culturel/models.py:1950
msgid "Comments"
msgstr "Commentaires"
@ -179,8 +179,8 @@ msgid "Receive notification of publication or leave a message for moderation"
msgstr "Être notifié de la publication ou laisser un message à la modération"
#: agenda_culturel/forms.py:171 agenda_culturel/models.py:185
#: agenda_culturel/models.py:627 agenda_culturel/models.py:2073
#: agenda_culturel/models.py:2183
#: agenda_culturel/models.py:627 agenda_culturel/models.py:2075
#: agenda_culturel/models.py:2185
msgid "Category"
msgstr "Catégorie"
@ -216,7 +216,7 @@ msgid "Details"
msgstr "Détails"
#: agenda_culturel/forms.py:324 agenda_culturel/models.py:657
#: agenda_culturel/models.py:2048
#: agenda_culturel/models.py:2050
msgid "Location"
msgstr "Localisation"
@ -310,7 +310,7 @@ msgid "Apply category {} to the event {}"
msgstr "Appliquer la catégorie {} à l'événement {}"
#: agenda_culturel/forms.py:746 agenda_culturel/models.py:473
#: agenda_culturel/models.py:2235
#: agenda_culturel/models.py:2237
msgid "Place"
msgstr "Lieu"
@ -351,7 +351,7 @@ msgstr "Ajouter un commentaire"
#: agenda_culturel/models.py:66 agenda_culturel/models.py:114
#: agenda_culturel/models.py:195 agenda_culturel/models.py:416
#: agenda_culturel/models.py:444 agenda_culturel/models.py:531
#: agenda_culturel/models.py:1917 agenda_culturel/models.py:2002
#: agenda_culturel/models.py:1919 agenda_culturel/models.py:2004
msgid "Name"
msgstr "Nom"
@ -588,7 +588,7 @@ msgstr "Organisme"
msgid "Organisations"
msgstr "Organismes"
#: agenda_culturel/models.py:572 agenda_culturel/models.py:2043
#: agenda_culturel/models.py:572 agenda_culturel/models.py:2045
msgid "Published"
msgstr "Publié"
@ -708,27 +708,27 @@ msgstr ""
msgid "Events"
msgstr "Événements"
#: agenda_culturel/models.py:1173
#: agenda_culturel/models.py:1174
msgid "Your event has been published"
msgstr "Ton événement a été publié"
#: agenda_culturel/models.py:1176
#: agenda_culturel/models.py:1177
msgid "Your message has not been retained"
msgstr "Ton événement n'a pas été retenu"
#: agenda_culturel/models.py:1332
#: agenda_culturel/models.py:1333
msgid "during import process"
msgstr "pendant le processus d'import"
#: agenda_culturel/models.py:1674
#: agenda_culturel/models.py:1675
msgid "Import"
msgstr "Import"
#: agenda_culturel/models.py:1675
#: agenda_culturel/models.py:1676
msgid "import process"
msgstr "processus d'import"
#: agenda_culturel/models.py:1676
#: agenda_culturel/models.py:1677
msgid ""
"The duration of the event is a little too long for direct publication. "
"Moderators can choose to publish it or not."
@ -736,151 +736,155 @@ msgstr ""
"La durée de l'événement est un peu trop longue pour qu'il soit publié "
"directement. Les modérateurs peuvent choisir de le publier ou non."
#: agenda_culturel/models.py:1876
#: agenda_culturel/models.py:1877
msgid "From contributor"
msgstr "D'un·e contributeurice"
#: agenda_culturel/models.py:1877
#: agenda_culturel/models.py:1878
msgid "Import process"
msgstr "Processus d'import"
#: agenda_culturel/models.py:1878
#: agenda_culturel/models.py:1879
msgid "Contact form"
msgstr "Formulaire de contact"
#: agenda_culturel/models.py:1879
#: agenda_culturel/models.py:1880
msgid "Event report"
msgstr "Signalemet d'événement"
#: agenda_culturel/models.py:1882 agenda_culturel/models.py:1930
#: agenda_culturel/models.py:1881
msgid "From contributor (without message)"
msgstr "D'un·e contributeurice (sans message)"
#: agenda_culturel/models.py:1884 agenda_culturel/models.py:1932
msgid "Message"
msgstr "Message"
#: agenda_culturel/models.py:1883
#: agenda_culturel/models.py:1885
msgid "Messages"
msgstr "Messages"
#: agenda_culturel/models.py:1894
#: agenda_culturel/models.py:1896
msgid "Subject"
msgstr "Sujet"
#: agenda_culturel/models.py:1895
#: agenda_culturel/models.py:1897
msgid "The subject of your message"
msgstr "Sujet de votre message"
#: agenda_culturel/models.py:1901
#: agenda_culturel/models.py:1903
msgid "Related event"
msgstr "Événement associé"
#: agenda_culturel/models.py:1902
#: agenda_culturel/models.py:1904
msgid "The message is associated with this event."
msgstr "Le message est associé à cet événement."
#: agenda_culturel/models.py:1910
#: agenda_culturel/models.py:1912
msgid "Author of the message"
msgstr "Auteur du message"
#: agenda_culturel/models.py:1918
#: agenda_culturel/models.py:1920
msgid "Your name"
msgstr "Votre nom"
#: agenda_culturel/models.py:1924
#: agenda_culturel/models.py:1926
msgid "Email address"
msgstr "Adresse email"
#: agenda_culturel/models.py:1930
#: agenda_culturel/models.py:1932
msgid "Your message"
msgstr "Votre message"
#: agenda_culturel/models.py:1936
#: agenda_culturel/models.py:1938
msgid "This message is a spam."
msgstr "Ce message est un spam."
#: agenda_culturel/models.py:1943
#: agenda_culturel/models.py:1945
msgid "this message has been processed and no longer needs to be handled"
msgstr "Ce message a été traité et ne nécessite plus d'être pris en charge"
#: agenda_culturel/models.py:1949
#: agenda_culturel/models.py:1951
msgid "Comments on the message from the moderation team"
msgstr "Commentaires sur ce message par l'équipe de modération"
#: agenda_culturel/models.py:1971 agenda_culturel/models.py:2131
#: agenda_culturel/models.py:1973 agenda_culturel/models.py:2133
msgid "Recurrent import"
msgstr "Import récurrent"
#: agenda_culturel/models.py:1972
#: agenda_culturel/models.py:1974
msgid "Recurrent imports"
msgstr "Imports récurrents"
#: agenda_culturel/models.py:1976
#: agenda_culturel/models.py:1978
msgid "ical"
msgstr "ical"
#: agenda_culturel/models.py:1977
#: agenda_culturel/models.py:1979
msgid "ical no busy"
msgstr "ical sans busy"
#: agenda_culturel/models.py:1978
#: agenda_culturel/models.py:1980
msgid "ical no VC"
msgstr "ical sans VC"
#: agenda_culturel/models.py:1979
#: agenda_culturel/models.py:1981
msgid "lacoope.org"
msgstr "lacoope.org"
#: agenda_culturel/models.py:1980
#: agenda_culturel/models.py:1982
msgid "la comédie"
msgstr "la comédie"
#: agenda_culturel/models.py:1981
#: agenda_culturel/models.py:1983
msgid "le fotomat"
msgstr "le fotomat"
#: agenda_culturel/models.py:1982
#: agenda_culturel/models.py:1984
msgid "la puce à l'oreille"
msgstr "la puce à loreille"
#: agenda_culturel/models.py:1983
#: agenda_culturel/models.py:1985
msgid "Plugin wordpress MEC"
msgstr "Plugin wordpress MEC"
#: agenda_culturel/models.py:1984
#: agenda_culturel/models.py:1986
msgid "Événements d'une page FB"
msgstr "Événements d'une page FB"
#: agenda_culturel/models.py:1985
#: agenda_culturel/models.py:1987
msgid "la cour des 3 coquins"
msgstr "la cour des 3 coquins"
#: agenda_culturel/models.py:1986
#: agenda_culturel/models.py:1988
msgid "Arachnée concert"
msgstr "Arachnée concert"
#: agenda_culturel/models.py:1987
#: agenda_culturel/models.py:1989
msgid "Le Rio"
msgstr "Le Rio"
#: agenda_culturel/models.py:1990
#: agenda_culturel/models.py:1992
msgid "simple"
msgstr "simple"
#: agenda_culturel/models.py:1991
#: agenda_culturel/models.py:1993
msgid "Headless Chromium"
msgstr "chromium sans interface"
#: agenda_culturel/models.py:1992
#: agenda_culturel/models.py:1994
msgid "Headless Chromium (pause)"
msgstr "chromium sans interface (pause)"
#: agenda_culturel/models.py:1997
#: agenda_culturel/models.py:1999
msgid "daily"
msgstr "chaque jour"
#: agenda_culturel/models.py:1999
#: agenda_culturel/models.py:2001
msgid "weekly"
msgstr "chaque semaine"
#: agenda_culturel/models.py:2004
#: agenda_culturel/models.py:2006
msgid ""
"Recurrent import name. Be careful to choose a name that is easy to "
"understand, as it will be public and displayed on the sites About page."
@ -888,151 +892,151 @@ msgstr ""
"Nom de l'import récurrent. Attention à choisir un nom compréhensible, car il "
"sera public, et affiché sur la page à propos du site."
#: agenda_culturel/models.py:2011
#: agenda_culturel/models.py:2013
msgid "Processor"
msgstr "Processeur"
#: agenda_culturel/models.py:2014
#: agenda_culturel/models.py:2016
msgid "Downloader"
msgstr "Téléchargeur"
#: agenda_culturel/models.py:2021
#: agenda_culturel/models.py:2023
msgid "Import recurrence"
msgstr "Récurrence d'import"
#: agenda_culturel/models.py:2028
#: agenda_culturel/models.py:2030
msgid "Source"
msgstr "Source"
#: agenda_culturel/models.py:2029
#: agenda_culturel/models.py:2031
msgid "URL of the source document"
msgstr "URL du document source"
#: agenda_culturel/models.py:2033
#: agenda_culturel/models.py:2035
msgid "Browsable url"
msgstr "URL navigable"
#: agenda_culturel/models.py:2035
#: agenda_culturel/models.py:2037
msgid "URL of the corresponding document that will be shown to visitors."
msgstr "URL correspondant au document et qui sera montrée aux visiteurs"
#: agenda_culturel/models.py:2044
#: agenda_culturel/models.py:2046
msgid "Status of each imported event (published or draft)"
msgstr "Status de chaque événement importé (publié ou brouillon)"
#: agenda_culturel/models.py:2049
#: agenda_culturel/models.py:2051
msgid "Address for each imported event"
msgstr "Adresse de chaque événement importé"
#: agenda_culturel/models.py:2056
#: agenda_culturel/models.py:2058
msgid "Force location"
msgstr "Focer la localisation"
#: agenda_culturel/models.py:2057
#: agenda_culturel/models.py:2059
msgid "force location even if another is detected."
msgstr "Forcer la localisation même si une autre a été détectée."
#: agenda_culturel/models.py:2063
#: agenda_culturel/models.py:2065
msgid "Organiser"
msgstr "Organisateur"
#: agenda_culturel/models.py:2064
#: agenda_culturel/models.py:2066
msgid "Organiser of each imported event"
msgstr "Organisateur de chaque événement importé"
#: agenda_culturel/models.py:2074
#: agenda_culturel/models.py:2076
msgid "Category of each imported event"
msgstr "Catégorie de chaque événement importé"
#: agenda_culturel/models.py:2082
#: agenda_culturel/models.py:2084
msgid "Tags for each imported event"
msgstr "Étiquettes de chaque événement importé"
#: agenda_culturel/models.py:2083
#: agenda_culturel/models.py:2085
msgid "A list of tags that describe each imported event."
msgstr "Une liste d'étiquettes décrivant chaque événement importé"
#: agenda_culturel/models.py:2112
#: agenda_culturel/models.py:2114
msgid "Running"
msgstr "En cours"
#: agenda_culturel/models.py:2113
#: agenda_culturel/models.py:2115
msgid "Canceled"
msgstr "Annulé"
#: agenda_culturel/models.py:2114
#: agenda_culturel/models.py:2116
msgid "Success"
msgstr "Succès"
#: agenda_culturel/models.py:2115
#: agenda_culturel/models.py:2117
msgid "Failed"
msgstr "Erreur"
#: agenda_culturel/models.py:2118
#: agenda_culturel/models.py:2120
msgid "Batch importation"
msgstr "Importation par lot"
#: agenda_culturel/models.py:2119
#: agenda_culturel/models.py:2121
msgid "Batch importations"
msgstr "Importations par lot"
#: agenda_culturel/models.py:2132
#: agenda_culturel/models.py:2134
msgid "Reference to the recurrent import processing"
msgstr "Référence du processus d'import récurrent"
#: agenda_culturel/models.py:2140
#: agenda_culturel/models.py:2142
msgid "URL (if not recurrent import)"
msgstr "URL (si pas d'import récurrent)"
#: agenda_culturel/models.py:2142
#: agenda_culturel/models.py:2144
msgid "Source URL if no RecurrentImport is associated."
msgstr "URL source si aucun import récurrent n'est associé"
#: agenda_culturel/models.py:2155
#: agenda_culturel/models.py:2157
msgid "Error message"
msgstr "Votre message"
#: agenda_culturel/models.py:2159
#: agenda_culturel/models.py:2161
msgid "Number of collected events"
msgstr "Nombre d'événements collectés"
#: agenda_culturel/models.py:2162
#: agenda_culturel/models.py:2164
msgid "Number of imported events"
msgstr "Nombre d'événements importés"
#: agenda_culturel/models.py:2165
#: agenda_culturel/models.py:2167
msgid "Number of updated events"
msgstr "Nombre d'événements mis à jour"
#: agenda_culturel/models.py:2168
#: agenda_culturel/models.py:2170
msgid "Number of removed events"
msgstr "Nombre d'événements supprimés"
#: agenda_culturel/models.py:2176
#: agenda_culturel/models.py:2178
msgid "Weight"
msgstr "Poids"
#: agenda_culturel/models.py:2177
#: agenda_culturel/models.py:2179
msgid "The lower is the weight, the earlier the filter is applied"
msgstr "Plus le poids est léger, plus le filtre sera appliqué tôt"
#: agenda_culturel/models.py:2184
#: agenda_culturel/models.py:2186
msgid "Category applied to the event"
msgstr "Catégorie appliquée à l'événement"
#: agenda_culturel/models.py:2189
#: agenda_culturel/models.py:2191
msgid "Contained in the title"
msgstr "Contenu dans le titre"
#: agenda_culturel/models.py:2190
#: agenda_culturel/models.py:2192
msgid "Text contained in the event title"
msgstr "Texte contenu dans le titre de l'événement"
#: agenda_culturel/models.py:2196
#: agenda_culturel/models.py:2198
msgid "Exact title extract"
msgstr "Extrait exact du titre"
#: agenda_culturel/models.py:2198
#: agenda_culturel/models.py:2200
msgid ""
"If checked, the extract will be searched for in the title using the exact "
"form (capitals, accents)."
@ -1040,19 +1044,19 @@ msgstr ""
"Si coché, l'extrait sera recherché dans le titre en utilisant la forme "
"exacte (majuscules, accents)"
#: agenda_culturel/models.py:2204
#: agenda_culturel/models.py:2206
msgid "Contained in the description"
msgstr "Contenu dans la description"
#: agenda_culturel/models.py:2205
#: agenda_culturel/models.py:2207
msgid "Text contained in the description"
msgstr "Texte contenu dans la description"
#: agenda_culturel/models.py:2211
#: agenda_culturel/models.py:2213
msgid "Exact description extract"
msgstr "Extrait exact de description"
#: agenda_culturel/models.py:2213
#: agenda_culturel/models.py:2215
msgid ""
"If checked, the extract will be searched for in the description using the "
"exact form (capitals, accents)."
@ -1060,19 +1064,19 @@ msgstr ""
"Si coché, l'extrait sera recherché dans la description en utilisant la forme "
"exacte (majuscules, accents)"
#: agenda_culturel/models.py:2219
#: agenda_culturel/models.py:2221
msgid "Contained in the location"
msgstr "Contenu dans la localisation"
#: agenda_culturel/models.py:2220
#: agenda_culturel/models.py:2222
msgid "Text contained in the event location"
msgstr "Texte contenu dans la localisation de l'événement"
#: agenda_culturel/models.py:2226
#: agenda_culturel/models.py:2228
msgid "Exact location extract"
msgstr "Extrait exact de localisation"
#: agenda_culturel/models.py:2228
#: agenda_culturel/models.py:2230
msgid ""
"If checked, the extract will be searched for in the location using the exact "
"form (capitals, accents)."
@ -1080,15 +1084,15 @@ msgstr ""
"Si coché, l'extrait sera recherché dans la localisation en utilisant la "
"forme exacte (majuscules, accents)"
#: agenda_culturel/models.py:2236
#: agenda_culturel/models.py:2238
msgid "Location from place"
msgstr "Localisation depuis le lieu"
#: agenda_culturel/models.py:2245
#: agenda_culturel/models.py:2247
msgid "Categorisation rule"
msgstr "Règle de catégorisation"
#: agenda_culturel/models.py:2246
#: agenda_culturel/models.py:2248
msgid "Categorisation rules"
msgstr "Règles de catégorisation"

View File

@ -0,0 +1,18 @@
# Generated by Django 4.2.9 on 2024-12-29 16:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda_culturel', '0131_message_message_type'),
]
operations = [
migrations.AlterField(
model_name='message',
name='message_type',
field=models.CharField(choices=[('from_contributor', 'From contributor'), ('import_process', 'Import process'), ('contact_form', 'Contact form'), ('event_report', 'Event report'), ('from_contrib_no_msg', 'From contributor (without message)')], default=None, max_length=20, null=True, verbose_name='Type'),
),
]

View File

@ -1150,12 +1150,13 @@ class Event(models.Model):
def get_contributor_message(self):
types = [Message.TYPE.FROM_CONTRIBUTOR, Message.TYPE.FROM_CONTRIBUTOR_NO_MSG]
if self.other_versions is None or self.other_versions.representative is None:
logger.warning("cas single")
return Message.objects.filter(related_event=self.pk, message_type=Message.TYPE.FROM_CONTRIBUTOR, closed=False)
return Message.objects.filter(related_event=self.pk, message_type__in=types, closed=False)
else:
logger.warning("cas multiple")
return Message.objects.filter(related_event__in=self.other_versions.get_duplicated(), message_type=Message.TYPE.FROM_CONTRIBUTOR, closed=False).first()
return Message.objects.filter(related_event__in=self.other_versions.get_duplicated(), message_typ__in=types, closed=False).first()
def notify_if_required(self, request):
@ -1327,12 +1328,12 @@ class Event(models.Model):
result = Event(**event_structure)
result.add_pending_organisers(organisers)
if email or comments:
has_comments = not comments in ["", None]
result.set_message(Message(subject=_('during import process'),
email=email,
message=comments,
closed=False,
message_type=Message.TYPE.FROM_CONTRIBUTOR))
message_type=Message.TYPE.FROM_CONTRIBUTOR if has_comments else Message.TYPE.FROM_CONTRIBUTOR_NO_MSG))
return result
@ -1875,6 +1876,7 @@ class Message(models.Model):
IMPORT_PROCESS = "import_process", _("Import process")
CONTACT_FORM = "contact_form", _("Contact form")
EVENT_REPORT = "event_report", _("Event report")
FROM_CONTRIBUTOR_NO_MSG = "from_contrib_no_msg", _("From contributor (without message)")
class Meta:
verbose_name = _("Message")
@ -1958,7 +1960,7 @@ class Message(models.Model):
)
def nb_open_messages():
return Message.objects.filter(Q(closed=False)&Q(spam=False)&Q(message_type__in=[Message.TYPE.CONTACT_FORM, Message.TYPE.EVENT_REPORT])).count()
return Message.objects.filter(Q(closed=False)&Q(spam=False)&Q(message_type__in=[Message.TYPE.CONTACT_FORM, Message.TYPE.EVENT_REPORT, Message.TYPE.FROM_CONTRIBUTOR])).count()
def get_absolute_url(self):
return reverse("message", kwargs={"pk": self.pk})

View File

@ -2,7 +2,7 @@
{% load static %}
{% load utils_extra %}
{% block title %}{% block og_title %}Message de contact : {{ obj.subject }}{% endblock %}{% endblock %}
{% block title %}{% block og_title %}Message {{ obj.subject }}{% endblock %}{% endblock %}
{% block entete_header %}
<script>window.CKEDITOR_BASEPATH = '/static/ckeditor/ckeditor/';</script>
@ -27,11 +27,12 @@
<a href="{% url 'delete_message' object.id %}" role="button" data-tooltip="Supprimer le message">Supprimer {% picto_from_name "trash-2" %}</a>
</div>
<h1>Modération du message «&nbsp;{{ object.subject }}&nbsp;»</h1>
<h1>Message «&nbsp;{{ object.subject }}&nbsp;»</h1>
<ul>
<li>Date&nbsp;: {{ object.date.date }} à {{ object.date.time }}</li>
<li>Auteur&nbsp;: {% if object.user %}<em>{{ object.user }}</em>{% else %}{{ object.name }}{% endif %} {% if object.email %}<a href="mailto:{{ object.email }}">{{ object.email }}</a>{% endif %}</li>
{% if object.related_event %}<li>Événement associé&nbsp;: <a href="{{ object.related_event.get_absolute_url }}">{{ object.related_event.title }}</a> du {{ object.related_event.start_day }}</li>{% endif %}
<li>Type&nbsp;: {% if object.message_type %}{{ object.get_message_type_display }}{% else %}-{% endif %}</li>
</ul>
</header>
<div>
@ -40,6 +41,15 @@
</article>
<article>
{% if object.message_type == "from_contributor" or object.message_type == "from_contrib_no_msg" %}<p class="message info">Ce message a été envoyé par une personne lors
de l'ajout d'un événement.
{% if object.closed %}
En décochant fermé, vous modifiez manuellement son statut, et cela pourra entraîner l'envoi d'un message de notification
lors de la modification future de l'événement associé.{% else %}
En cochant fermé, vous modifiez manuellement son statut, et cela empêchera l'envoi d'un message de notification
lors de la modification future de l'événement associé.
{% endif %}
</p>{% endif %}
<form method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Enregistrer">

View File

@ -18,7 +18,7 @@ def show_badge_messages(placement="top"):
return mark_safe(
'<a href="'
+ reverse_lazy("messages")
+ '?closed=False&message_type=contact_form&message_type=event_report" class="badge" data-placement="'
+ '?closed=False&message_type=contact_form&message_type=event_report&message_type=from_contributor" class="badge" data-placement="'
+ placement
+ '" data-tooltip="'
+ str(nb_open)

View File

@ -598,12 +598,13 @@ class EventCreateView(SuccessMessageMixin, CreateView):
form.instance.set_in_moderation_process()
if form.cleaned_data.get("email") or form.cleaned_data.get("comments"):
has_comments = not form.cleaned_data.get("comments") in ["", None]
form.instance.set_message(
Message(subject=_('during the creation process'),
message=form.cleaned_data["comments"],
email=form.cleaned_data["email"]),
message=form.cleaned_data.get("comments"),
email=form.cleaned_data.get("email"),
closed=False,
message_type=Message.TYPE.FROM_CONTRIBUTOR)
message_type=Message.TYPE.FROM_CONTRIBUTOR if has_comments else Message.TYPE.FROM_CONTRIBUTOR_NO_MSG))
form.instance.import_sources = None
form.instance.set_processing_user(self.request.user)