Affichage d'information sur le nettoyage des dupliqués

This commit is contained in:
Jean-Marie Favreau 2024-04-28 12:26:43 +02:00
parent 0f193ea902
commit f92d62127b
3 changed files with 124 additions and 116 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: agenda_culturel\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-27 18:16+0000\n"
"POT-Creation-Date: 2024-04-28 10:25+0000\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"
@ -33,7 +33,7 @@ msgstr "JSON dans le format attendu pour l'import"
msgid "Apply category {} to the event {}"
msgstr "Appliquer la catégorie {} à l'événement {}"
#: agenda_culturel/forms.py:298 agenda_culturel/models.py:170
#: agenda_culturel/forms.py:298 agenda_culturel/models.py:167
msgid "Place"
msgstr "Lieu"
@ -56,8 +56,8 @@ msgid "Cannot extract event from url {}"
msgstr "Impossible d'extraire l'événement depuis l'url {}"
#: agenda_culturel/models.py:39 agenda_culturel/models.py:68
#: agenda_culturel/models.py:162 agenda_culturel/models.py:792
#: agenda_culturel/models.py:831
#: agenda_culturel/models.py:159 agenda_culturel/models.py:815
#: agenda_culturel/models.py:854
msgid "Name"
msgstr "Nom"
@ -106,7 +106,7 @@ msgid "Color used as background for the category"
msgstr "Couleur utilisée comme fond de la catégorie"
#: agenda_culturel/models.py:115 agenda_culturel/models.py:227
#: agenda_culturel/models.py:843 agenda_culturel/models.py:894
#: agenda_culturel/models.py:866 agenda_culturel/models.py:917
msgid "Category"
msgstr "Catégorie"
@ -114,31 +114,31 @@ msgstr "Catégorie"
msgid "Categories"
msgstr "Catégories"
#: agenda_culturel/models.py:162
#: agenda_culturel/models.py:159
msgid "Name of the place"
msgstr "Nom du lieu"
#: agenda_culturel/models.py:163
#: agenda_culturel/models.py:160
msgid "Address"
msgstr "Adresse"
#: agenda_culturel/models.py:163
#: agenda_culturel/models.py:160
msgid "Address of this place (without city name)"
msgstr "Adresse de ce lieu (sans le nom de la ville)"
#: agenda_culturel/models.py:164
#: agenda_culturel/models.py:161
msgid "City"
msgstr "Ville"
#: agenda_culturel/models.py:164
#: agenda_culturel/models.py:161
msgid "City name"
msgstr "Nom de la ville"
#: agenda_culturel/models.py:167
#: agenda_culturel/models.py:164
msgid "Alternative names"
msgstr "Noms alternatifs"
#: agenda_culturel/models.py:167
#: agenda_culturel/models.py:164
msgid ""
"Alternative names or addresses used to match a place with the free-form "
"location of an event."
@ -146,11 +146,11 @@ msgstr ""
"Noms et adresses alternatives qui seront utilisées pour associer une adresse "
"avec la localisation en forme libre d'un événement"
#: agenda_culturel/models.py:171
#: agenda_culturel/models.py:168
msgid "Places"
msgstr "Lieux"
#: agenda_culturel/models.py:211 agenda_culturel/models.py:841
#: agenda_culturel/models.py:211 agenda_culturel/models.py:864
msgid "Published"
msgstr "Publié"
@ -170,7 +170,7 @@ msgstr "Titre"
msgid "Short title"
msgstr "Titre court"
#: agenda_culturel/models.py:225 agenda_culturel/models.py:878
#: agenda_culturel/models.py:225 agenda_culturel/models.py:901
msgid "Status"
msgstr "Status"
@ -204,7 +204,7 @@ msgstr "Heure de fin"
msgid "Recurrence"
msgstr "Récurrence"
#: agenda_culturel/models.py:237 agenda_culturel/models.py:842
#: agenda_culturel/models.py:237 agenda_culturel/models.py:865
msgid "Location"
msgstr "Localisation"
@ -300,111 +300,111 @@ msgstr "Événement"
msgid "Events"
msgstr "Événements"
#: agenda_culturel/models.py:788
#: agenda_culturel/models.py:811
msgid "Contact message"
msgstr "Message de contact"
#: agenda_culturel/models.py:789
#: agenda_culturel/models.py:812
msgid "Contact messages"
msgstr "Messages de contact"
#: agenda_culturel/models.py:791
#: agenda_culturel/models.py:814
msgid "Subject"
msgstr "Sujet"
#: agenda_culturel/models.py:791
#: agenda_culturel/models.py:814
msgid "The subject of your message"
msgstr "Sujet de votre message"
#: agenda_culturel/models.py:792
#: agenda_culturel/models.py:815
msgid "Your name"
msgstr "Votre nom"
#: agenda_culturel/models.py:793
#: agenda_culturel/models.py:816
msgid "Email address"
msgstr "Adresse email"
#: agenda_culturel/models.py:793
#: agenda_culturel/models.py:816
msgid "Your email address"
msgstr "Votre adresse email"
#: agenda_culturel/models.py:794
#: agenda_culturel/models.py:817
msgid "Message"
msgstr "Message"
#: agenda_culturel/models.py:794
#: agenda_culturel/models.py:817
msgid "Your message"
msgstr "Votre message"
#: agenda_culturel/models.py:798 agenda_culturel/views.py:470
#: agenda_culturel/models.py:821 agenda_culturel/views.py:470
msgid "Closed"
msgstr "Fermé"
#: agenda_culturel/models.py:798
#: agenda_culturel/models.py:821
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:799
#: agenda_culturel/models.py:822
msgid "Comments"
msgstr "Commentaires"
#: agenda_culturel/models.py:799
#: agenda_culturel/models.py:822
msgid "Comments on the message from the moderation team"
msgstr "Commentaires sur ce message par l'équipe de modération"
#: agenda_culturel/models.py:809 agenda_culturel/models.py:876
#: agenda_culturel/models.py:832 agenda_culturel/models.py:899
msgid "Recurrent import"
msgstr "Import récurrent"
#: agenda_culturel/models.py:810
#: agenda_culturel/models.py:833
msgid "Recurrent imports"
msgstr "Imports récurrents"
#: agenda_culturel/models.py:814
#: agenda_culturel/models.py:837
msgid "ical"
msgstr "ical"
#: agenda_culturel/models.py:815
#: agenda_culturel/models.py:838
msgid "ical no busy"
msgstr "ical sans busy"
#: agenda_culturel/models.py:816
#: agenda_culturel/models.py:839
msgid "ical no VC"
msgstr "ical sans VC"
#: agenda_culturel/models.py:817
#: agenda_culturel/models.py:840
msgid "lacoope.org"
msgstr "lacoope.org"
#: agenda_culturel/models.py:818
#: agenda_culturel/models.py:841
msgid "la comédie"
msgstr "la comédie"
#: agenda_culturel/models.py:819
#: agenda_culturel/models.py:842
msgid "le fotomat"
msgstr "le fotomat"
#: agenda_culturel/models.py:820
#: agenda_culturel/models.py:843
msgid "la puce à loreille"
msgstr "la puce à loreille"
#: agenda_culturel/models.py:823
#: agenda_culturel/models.py:846
msgid "simple"
msgstr "simple"
#: agenda_culturel/models.py:824
#: agenda_culturel/models.py:847
msgid "Headless Chromium"
msgstr "chromium sans interface"
#: agenda_culturel/models.py:828
#: agenda_culturel/models.py:851
msgid "daily"
msgstr "chaque jour"
#: agenda_culturel/models.py:829
#: agenda_culturel/models.py:852
msgid "weekly"
msgstr "chaque semaine"
#: agenda_culturel/models.py:831
#: agenda_culturel/models.py:854
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."
@ -412,127 +412,127 @@ 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:832
#: agenda_culturel/models.py:855
msgid "Processor"
msgstr "Processeur"
#: agenda_culturel/models.py:833
#: agenda_culturel/models.py:856
msgid "Downloader"
msgstr "Téléchargeur"
#: agenda_culturel/models.py:835
#: agenda_culturel/models.py:858
msgid "Import recurrence"
msgstr "Récurrence d'import"
#: agenda_culturel/models.py:838
#: agenda_culturel/models.py:861
msgid "Source"
msgstr "Source"
#: agenda_culturel/models.py:838
#: agenda_culturel/models.py:861
msgid "URL of the source document"
msgstr "URL du document source"
#: agenda_culturel/models.py:839
#: agenda_culturel/models.py:862
msgid "Browsable url"
msgstr "URL navigable"
#: agenda_culturel/models.py:839
#: agenda_culturel/models.py:862
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:841
#: agenda_culturel/models.py:864
msgid "Status of each imported event (published or draft)"
msgstr "Status de chaque événement importé (publié ou brouillon)"
#: agenda_culturel/models.py:842
#: agenda_culturel/models.py:865
msgid "Address for each imported event"
msgstr "Adresse de chaque événement importé"
#: agenda_culturel/models.py:843
#: agenda_culturel/models.py:866
msgid "Category of each imported event"
msgstr "Catégorie de chaque événement importé"
#: agenda_culturel/models.py:844
#: agenda_culturel/models.py:867
msgid "Tags for each imported event"
msgstr "Étiquettes de chaque événement importé"
#: agenda_culturel/models.py:844
#: agenda_culturel/models.py:867
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:863
#: agenda_culturel/models.py:886
msgid "Running"
msgstr "En cours"
#: agenda_culturel/models.py:864
#: agenda_culturel/models.py:887
msgid "Canceled"
msgstr "Annulé"
#: agenda_culturel/models.py:865
#: agenda_culturel/models.py:888
msgid "Success"
msgstr "Succès"
#: agenda_culturel/models.py:866
#: agenda_culturel/models.py:889
msgid "Failed"
msgstr "Erreur"
#: agenda_culturel/models.py:869
#: agenda_culturel/models.py:892
msgid "Batch importation"
msgstr "Importation par lot"
#: agenda_culturel/models.py:870
#: agenda_culturel/models.py:893
msgid "Batch importations"
msgstr "Importations par lot"
#: agenda_culturel/models.py:876
#: agenda_culturel/models.py:899
msgid "Reference to the recurrent import processing"
msgstr "Référence du processus d'import récurrent"
#: agenda_culturel/models.py:880
#: agenda_culturel/models.py:903
msgid "Error message"
msgstr "Votre message"
#: agenda_culturel/models.py:882
#: agenda_culturel/models.py:905
msgid "Number of collected events"
msgstr "Nombre d'événements collectés"
#: agenda_culturel/models.py:883
#: agenda_culturel/models.py:906
msgid "Number of imported events"
msgstr "Nombre d'événements importés"
#: agenda_culturel/models.py:884
#: agenda_culturel/models.py:907
msgid "Number of updated events"
msgstr "Nombre d'événements mis à jour"
#: agenda_culturel/models.py:885
#: agenda_culturel/models.py:908
msgid "Number of removed events"
msgstr "Nombre d'événements supprimés"
#: agenda_culturel/models.py:892
#: agenda_culturel/models.py:915
msgid "Weight"
msgstr "Poids"
#: agenda_culturel/models.py:892
#: agenda_culturel/models.py:915
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:894
#: agenda_culturel/models.py:917
msgid "Category applied to the event"
msgstr "Catégorie appliquée à l'événement"
#: agenda_culturel/models.py:896
#: agenda_culturel/models.py:919
msgid "Contained in the title"
msgstr "Contenu dans le titre"
#: agenda_culturel/models.py:896
#: agenda_culturel/models.py:919
msgid "Text contained in the event title"
msgstr "Texte contenu dans le titre de l'événement"
#: agenda_culturel/models.py:897
#: agenda_culturel/models.py:920
msgid "Exact title extract"
msgstr "Extrait exact du titre"
#: agenda_culturel/models.py:897
#: agenda_culturel/models.py:920
msgid ""
"If checked, the extract will be searched for in the title using the exact "
"form (capitals, accents)."
@ -540,19 +540,19 @@ msgstr ""
"Si coché, l'extrait sera recherché dans le titre en utilisant la forme "
"exacte (majuscules, accents)"
#: agenda_culturel/models.py:899
#: agenda_culturel/models.py:922
msgid "Contained in the description"
msgstr "Contenu dans la description"
#: agenda_culturel/models.py:899
#: agenda_culturel/models.py:922
msgid "Text contained in the description"
msgstr "Texte contenu dans la description"
#: agenda_culturel/models.py:900
#: agenda_culturel/models.py:923
msgid "Exact description extract"
msgstr "Extrait exact de description"
#: agenda_culturel/models.py:900
#: agenda_culturel/models.py:923
msgid ""
"If checked, the extract will be searched for in the description using the "
"exact form (capitals, accents)."
@ -560,19 +560,19 @@ msgstr ""
"Si coché, l'extrait sera recherché dans la description en utilisant la forme "
"exacte (majuscules, accents)"
#: agenda_culturel/models.py:902
#: agenda_culturel/models.py:925
msgid "Contained in the location"
msgstr "Contenu dans la localisation"
#: agenda_culturel/models.py:902
#: agenda_culturel/models.py:925
msgid "Text contained in the event location"
msgstr "Texte contenu dans la localisation de l'événement"
#: agenda_culturel/models.py:903
#: agenda_culturel/models.py:926
msgid "Exact location extract"
msgstr "Extrait exact de localisation"
#: agenda_culturel/models.py:903
#: agenda_culturel/models.py:926
msgid ""
"If checked, the extract will be searched for in the location using the exact "
"form (capitals, accents)."
@ -580,61 +580,61 @@ msgstr ""
"Si coché, l'extrait sera recherché dans la localisation en utilisant la "
"forme exacte (majuscules, accents)"
#: agenda_culturel/models.py:906
#: agenda_culturel/models.py:929
msgid "Categorisation rule"
msgstr "Règle de catégorisation"
#: agenda_culturel/models.py:907
#: agenda_culturel/models.py:930
msgid "Categorisation rules"
msgstr "Règles de catégorisation"
#: agenda_culturel/models.py:963 agenda_culturel/models.py:984
#: agenda_culturel/models.py:986 agenda_culturel/models.py:1007
msgid "Question"
msgstr "Question"
#: agenda_culturel/models.py:963 agenda_culturel/models.py:986
#: agenda_culturel/models.py:986 agenda_culturel/models.py:1009
msgid "Text that will be shown to moderators"
msgstr "Text tel que présenté aux modérateurices"
#: agenda_culturel/models.py:966
#: agenda_culturel/models.py:989
msgid "Moderation question"
msgstr "Question de modération"
#: agenda_culturel/models.py:967
#: agenda_culturel/models.py:990
msgid "Moderation questions"
msgstr "Questions de modération"
#: agenda_culturel/models.py:984
#: agenda_culturel/models.py:1007
msgid "Associated question from moderation"
msgstr "Question associée pour la modération"
#: agenda_culturel/models.py:986
#: agenda_culturel/models.py:1009
msgid "Answer"
msgstr "Réponse"
#: agenda_culturel/models.py:988
#: agenda_culturel/models.py:1011
msgid "Adds tags"
msgstr "Ajoute les étiquettes"
#: agenda_culturel/models.py:988
#: agenda_culturel/models.py:1011
msgid "A list of tags that will be added if you choose this answer."
msgstr ""
"Une liste d'étiquettes qui seront ajoutées si vous choisissez cette réponse."
#: agenda_culturel/models.py:989
#: agenda_culturel/models.py:1012
msgid "Removes tags"
msgstr "Retire les étiquettes"
#: agenda_culturel/models.py:989
#: agenda_culturel/models.py:1012
msgid "A list of tags that will be removed if you choose this answer."
msgstr ""
"Une liste d'étiquettes qui seront retirées si vous choisissez cette réponse."
#: agenda_culturel/settings/base.py:138
#: agenda_culturel/settings/base.py:139
msgid "English"
msgstr "anglais"
#: agenda_culturel/settings/base.py:139
#: agenda_culturel/settings/base.py:140
msgid "French"
msgstr "français"
@ -763,11 +763,15 @@ msgstr ""
msgid "The event has been withdrawn from the group and made independent."
msgstr "L'événement a été retiré du groupe et rendu indépendant."
#: agenda_culturel/views.py:901
#: agenda_culturel/views.py:877
msgid "Cleaning up duplicates: {} item(s) removed."
msgstr "Nettoyage des dupliqués: {} élément(s) supprimés."
#: agenda_culturel/views.py:905
msgid "The event was successfully duplicated."
msgstr "L'événement a été marqué dupliqué avec succès."
#: agenda_culturel/views.py:904
#: agenda_culturel/views.py:908
msgid ""
"The event has been successfully flagged as a duplicate. The moderation team "
"will deal with your suggestion shortly."
@ -775,63 +779,63 @@ msgstr ""
"L'événement a été signalé comme dupliqué avec succès. Votre suggestion sera "
"prochainement prise en charge par l'équipe de modération."
#: agenda_culturel/views.py:943
#: agenda_culturel/views.py:947
msgid "The categorisation rule has been successfully modified."
msgstr "La règle de catégorisation a été modifiée avec succès."
#: agenda_culturel/views.py:950
#: agenda_culturel/views.py:954
msgid "The categorisation rule has been successfully deleted."
msgstr "La règle de catégorisation a été supprimée avec succès"
#: agenda_culturel/views.py:970 agenda_culturel/views.py:999
#: agenda_culturel/views.py:974 agenda_culturel/views.py:1003
msgid "The rules were successfully applied and 1 event was categorised."
msgstr ""
"Les règles ont été appliquées avec succès et 1 événement a été catégorisé"
#: agenda_culturel/views.py:972 agenda_culturel/views.py:1001
#: agenda_culturel/views.py:976 agenda_culturel/views.py:1005
msgid "The rules were successfully applied and {} events were categorised."
msgstr ""
"Les règles ont été appliquées avec succès et {} événements ont été "
"catégorisés"
#: agenda_culturel/views.py:974 agenda_culturel/views.py:1003
#: agenda_culturel/views.py:978 agenda_culturel/views.py:1007
msgid "The rules were successfully applied and no events were categorised."
msgstr ""
"Les règles ont été appliquées avec succès et aucun événement n'a été "
"catégorisé"
#: agenda_culturel/views.py:1031
#: agenda_culturel/views.py:1035
msgid "The moderation question has been created with success."
msgstr "La question de modération a été créée avec succès."
#: agenda_culturel/views.py:1112 agenda_culturel/views.py:1167
#: agenda_culturel/views.py:1196
#: agenda_culturel/views.py:1116 agenda_culturel/views.py:1172
#: agenda_culturel/views.py:1201
msgid "{} events have been updated."
msgstr "{} événements ont été mis à jour."
#: agenda_culturel/views.py:1114 agenda_culturel/views.py:1169
#: agenda_culturel/views.py:1198
#: agenda_culturel/views.py:1118 agenda_culturel/views.py:1174
#: agenda_culturel/views.py:1203
msgid "1 event has been updated."
msgstr "1 événement a été mis à jour"
#: agenda_culturel/views.py:1116 agenda_culturel/views.py:1171
#: agenda_culturel/views.py:1200
#: agenda_culturel/views.py:1120 agenda_culturel/views.py:1176
#: agenda_culturel/views.py:1205
msgid "No events have been modified."
msgstr "Aucun événement n'a été modifié."
#: agenda_culturel/views.py:1124
#: agenda_culturel/views.py:1128
msgid "The place has been successfully updated."
msgstr "Le lieu a été modifié avec succès."
#: agenda_culturel/views.py:1131
#: agenda_culturel/views.py:1135
msgid "The place has been successfully created."
msgstr "Le lieu a été créé avec succès."
#: agenda_culturel/views.py:1189
#: agenda_culturel/views.py:1194
msgid "The selected place has been assigned to the event."
msgstr "Le lieu sélectionné a été assigné à l'événement."
#: agenda_culturel/views.py:1191
#: agenda_culturel/views.py:1196
msgid "A new alias has been added to the selected place."
msgstr "Un nouvel alias a été créé pour le lieu sélectionné."

View File

@ -150,8 +150,10 @@ class DuplicatedEvents(models.Model):
def remove_singletons():
singletons = DuplicatedEvents.objects.annotate(nb_events=Count("event")).filter(nb_events__lte=1)
logger.warning("Removing: " + str(len(singletons)) + " empty or singleton duplicated")
nb = len(singletons)
logger.warning("Removing: " + str(nb) + " empty or singleton duplicated")
singletons.delete()
return nb
class Place(models.Model):
name = models.CharField(verbose_name=_('Name'), help_text=_('Name of the place'))

View File

@ -872,7 +872,9 @@ class DuplicatedEventsUpdateView(LoginRequiredMixin, UpdateView):
@login_required(login_url="/accounts/login/")
@permission_required('agenda_culturel.view_duplicatedevents')
def duplicates(request):
DuplicatedEvents.remove_singletons()
nb_removed = DuplicatedEvents.remove_singletons()
if nb_removed:
messages.success(request, _("Cleaning up duplicates: {} item(s) removed.").format(nb_removed))
paginator = Paginator(DuplicatedEvents.objects.all(), 10)
page = request.GET.get('page')