diff --git a/src/agenda_culturel/celery.py b/src/agenda_culturel/celery.py index d1a757c..8c68cd4 100644 --- a/src/agenda_culturel/celery.py +++ b/src/agenda_culturel/celery.py @@ -151,6 +151,15 @@ def daily_imports(self): for imp in imports: run_recurrent_import.delay(imp.pk) +@app.task(bind=True) +def run_all_recurrent_imports(self): + from agenda_culturel.models import RecurrentImport + logger.info("Imports complets") + imports = RecurrentImport.objects.all() + + for imp in imports: + run_recurrent_import.delay(imp.pk) + @app.task(bind=True) def weekly_imports(self): diff --git a/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po b/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po index f81d06c..a2a6be2 100644 --- a/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po +++ b/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: agenda_culturel\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-28 10:25+0000\n" +"POT-Creation-Date: 2024-04-28 12:29+0000\n" "PO-Revision-Date: 2023-10-29 14:16+0000\n" "Last-Translator: Jean-Marie Favreau \n" "Language-Team: Jean-Marie Favreau \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:167 +#: agenda_culturel/forms.py:298 agenda_culturel/models.py:186 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:159 agenda_culturel/models.py:815 -#: agenda_culturel/models.py:854 +#: agenda_culturel/models.py:178 agenda_culturel/models.py:843 +#: agenda_culturel/models.py:882 msgid "Name" msgstr "Nom" @@ -105,8 +105,8 @@ msgstr "Couleur" 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:866 agenda_culturel/models.py:917 +#: agenda_culturel/models.py:115 agenda_culturel/models.py:246 +#: agenda_culturel/models.py:894 agenda_culturel/models.py:945 msgid "Category" msgstr "Catégorie" @@ -114,31 +114,31 @@ msgstr "Catégorie" msgid "Categories" msgstr "Catégories" -#: agenda_culturel/models.py:159 +#: agenda_culturel/models.py:178 msgid "Name of the place" msgstr "Nom du lieu" -#: agenda_culturel/models.py:160 +#: agenda_culturel/models.py:179 msgid "Address" msgstr "Adresse" -#: agenda_culturel/models.py:160 +#: agenda_culturel/models.py:179 msgid "Address of this place (without city name)" msgstr "Adresse de ce lieu (sans le nom de la ville)" -#: agenda_culturel/models.py:161 +#: agenda_culturel/models.py:180 msgid "City" msgstr "Ville" -#: agenda_culturel/models.py:161 +#: agenda_culturel/models.py:180 msgid "City name" msgstr "Nom de la ville" -#: agenda_culturel/models.py:164 +#: agenda_culturel/models.py:183 msgid "Alternative names" msgstr "Noms alternatifs" -#: agenda_culturel/models.py:164 +#: agenda_culturel/models.py:183 msgid "" "Alternative names or addresses used to match a place with the free-form " "location of an event." @@ -146,77 +146,77 @@ 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:168 +#: agenda_culturel/models.py:187 msgid "Places" msgstr "Lieux" -#: agenda_culturel/models.py:211 agenda_culturel/models.py:864 +#: agenda_culturel/models.py:230 agenda_culturel/models.py:892 msgid "Published" msgstr "Publié" -#: agenda_culturel/models.py:212 +#: agenda_culturel/models.py:231 msgid "Draft" msgstr "Brouillon" -#: agenda_culturel/models.py:213 +#: agenda_culturel/models.py:232 msgid "Trash" msgstr "Corbeille" -#: agenda_culturel/models.py:223 +#: agenda_culturel/models.py:242 msgid "Title" msgstr "Titre" -#: agenda_culturel/models.py:223 +#: agenda_culturel/models.py:242 msgid "Short title" msgstr "Titre court" -#: agenda_culturel/models.py:225 agenda_culturel/models.py:901 +#: agenda_culturel/models.py:244 agenda_culturel/models.py:929 msgid "Status" msgstr "Status" -#: agenda_culturel/models.py:227 +#: agenda_culturel/models.py:246 msgid "Category of the event" msgstr "Catégorie de l'événement" -#: agenda_culturel/models.py:229 +#: agenda_culturel/models.py:248 msgid "Day of the event" msgstr "Date de l'événement" -#: agenda_culturel/models.py:230 +#: agenda_culturel/models.py:249 msgid "Starting time" msgstr "Heure de début" -#: agenda_culturel/models.py:232 +#: agenda_culturel/models.py:251 msgid "End day of the event" msgstr "Fin de l'événement" -#: agenda_culturel/models.py:232 +#: agenda_culturel/models.py:251 msgid "End day of the event, only required if different from the start day." msgstr "" "Date de fin de l'événement, uniquement nécessaire s'il est différent du " "premier jour de l'événement" -#: agenda_culturel/models.py:233 +#: agenda_culturel/models.py:252 msgid "Final time" msgstr "Heure de fin" -#: agenda_culturel/models.py:235 +#: agenda_culturel/models.py:254 msgid "Recurrence" msgstr "Récurrence" -#: agenda_culturel/models.py:237 agenda_culturel/models.py:865 +#: agenda_culturel/models.py:256 agenda_culturel/models.py:893 msgid "Location" msgstr "Localisation" -#: agenda_culturel/models.py:237 +#: agenda_culturel/models.py:256 msgid "Address of the event" msgstr "Adresse de l'événement" -#: agenda_culturel/models.py:238 +#: agenda_culturel/models.py:257 msgid "Location (free form)" msgstr "Localisation (forme libre)" -#: agenda_culturel/models.py:238 +#: agenda_culturel/models.py:257 msgid "" "Address of the event in case its not available in the already known places " "(free form)" @@ -224,187 +224,187 @@ msgstr "" "Addresse d'un événement si elle n'est pas déjà présente dans la liste des " "lieux disponible (forme libre)" -#: agenda_culturel/models.py:240 +#: agenda_culturel/models.py:259 msgid "Description" msgstr "Description" -#: agenda_culturel/models.py:240 +#: agenda_culturel/models.py:259 msgid "General description of the event" msgstr "Description générale de l'événement" -#: agenda_culturel/models.py:242 +#: agenda_culturel/models.py:261 msgid "Illustration (local image)" msgstr "Illustration (image locale)" -#: agenda_culturel/models.py:242 +#: agenda_culturel/models.py:261 msgid "Illustration image stored in the agenda server" msgstr "Image d'illustration stockée sur le serveur de l'agenda" -#: agenda_culturel/models.py:244 +#: agenda_culturel/models.py:263 msgid "Illustration" msgstr "Illustration" -#: agenda_culturel/models.py:244 +#: agenda_culturel/models.py:263 msgid "URL of the illustration image" msgstr "URL de l'image illustrative" -#: agenda_culturel/models.py:245 +#: agenda_culturel/models.py:264 msgid "Illustration description" msgstr "Description de l'illustration" -#: agenda_culturel/models.py:245 +#: agenda_culturel/models.py:264 msgid "Alternative text used by screen readers for the image" msgstr "Texte alternatif utiliser par les lecteurs d'écrans pour l'image" -#: agenda_culturel/models.py:247 +#: agenda_culturel/models.py:266 msgid "Importation source" msgstr "Source d'importation" -#: agenda_culturel/models.py:247 +#: agenda_culturel/models.py:266 msgid "Importation source used to detect removed entries." msgstr "Source d'importation utilisée pour détecter les éléments supprimés/" -#: agenda_culturel/models.py:248 +#: agenda_culturel/models.py:267 msgid "UUIDs" msgstr "UUIDs" -#: agenda_culturel/models.py:248 +#: agenda_culturel/models.py:267 msgid "UUIDs from import to detect duplicated entries." msgstr "UUIDs utilisés pendant l'import pour détecter les entrées dupliquées" -#: agenda_culturel/models.py:249 +#: agenda_culturel/models.py:268 msgid "URLs" msgstr "URLs" -#: agenda_culturel/models.py:249 +#: agenda_culturel/models.py:268 msgid "List of all the urls where this event can be found." msgstr "Liste de toutes les urls où l'événement peut être trouvé." -#: agenda_culturel/models.py:251 +#: agenda_culturel/models.py:270 msgid "Tags" msgstr "Étiquettes" -#: agenda_culturel/models.py:251 +#: agenda_culturel/models.py:270 msgid "A list of tags that describe the event." msgstr "Une liste d'étiquettes décrivant l'événement" -#: agenda_culturel/models.py:253 +#: agenda_culturel/models.py:272 msgid "Possibly duplicated" msgstr "Possibles doublons" -#: agenda_culturel/models.py:294 +#: agenda_culturel/models.py:313 msgid "Event" msgstr "Événement" -#: agenda_culturel/models.py:295 +#: agenda_culturel/models.py:314 msgid "Events" msgstr "Événements" -#: agenda_culturel/models.py:811 +#: agenda_culturel/models.py:839 msgid "Contact message" msgstr "Message de contact" -#: agenda_culturel/models.py:812 +#: agenda_culturel/models.py:840 msgid "Contact messages" msgstr "Messages de contact" -#: agenda_culturel/models.py:814 +#: agenda_culturel/models.py:842 msgid "Subject" msgstr "Sujet" -#: agenda_culturel/models.py:814 +#: agenda_culturel/models.py:842 msgid "The subject of your message" msgstr "Sujet de votre message" -#: agenda_culturel/models.py:815 +#: agenda_culturel/models.py:843 msgid "Your name" msgstr "Votre nom" -#: agenda_culturel/models.py:816 +#: agenda_culturel/models.py:844 msgid "Email address" msgstr "Adresse email" -#: agenda_culturel/models.py:816 +#: agenda_culturel/models.py:844 msgid "Your email address" msgstr "Votre adresse email" -#: agenda_culturel/models.py:817 +#: agenda_culturel/models.py:845 msgid "Message" msgstr "Message" -#: agenda_culturel/models.py:817 +#: agenda_culturel/models.py:845 msgid "Your message" msgstr "Votre message" -#: agenda_culturel/models.py:821 agenda_culturel/views.py:470 +#: agenda_culturel/models.py:849 agenda_culturel/views.py:470 msgid "Closed" msgstr "Fermé" -#: agenda_culturel/models.py:821 +#: agenda_culturel/models.py:849 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:822 +#: agenda_culturel/models.py:850 msgid "Comments" msgstr "Commentaires" -#: agenda_culturel/models.py:822 +#: agenda_culturel/models.py:850 msgid "Comments on the message from the moderation team" msgstr "Commentaires sur ce message par l'équipe de modération" -#: agenda_culturel/models.py:832 agenda_culturel/models.py:899 +#: agenda_culturel/models.py:860 agenda_culturel/models.py:927 msgid "Recurrent import" msgstr "Import récurrent" -#: agenda_culturel/models.py:833 +#: agenda_culturel/models.py:861 msgid "Recurrent imports" msgstr "Imports récurrents" -#: agenda_culturel/models.py:837 +#: agenda_culturel/models.py:865 msgid "ical" msgstr "ical" -#: agenda_culturel/models.py:838 +#: agenda_culturel/models.py:866 msgid "ical no busy" msgstr "ical sans busy" -#: agenda_culturel/models.py:839 +#: agenda_culturel/models.py:867 msgid "ical no VC" msgstr "ical sans VC" -#: agenda_culturel/models.py:840 +#: agenda_culturel/models.py:868 msgid "lacoope.org" msgstr "lacoope.org" -#: agenda_culturel/models.py:841 +#: agenda_culturel/models.py:869 msgid "la comédie" msgstr "la comédie" -#: agenda_culturel/models.py:842 +#: agenda_culturel/models.py:870 msgid "le fotomat" msgstr "le fotomat" -#: agenda_culturel/models.py:843 +#: agenda_culturel/models.py:871 msgid "la puce à loreille" msgstr "la puce à loreille" -#: agenda_culturel/models.py:846 +#: agenda_culturel/models.py:874 msgid "simple" msgstr "simple" -#: agenda_culturel/models.py:847 +#: agenda_culturel/models.py:875 msgid "Headless Chromium" msgstr "chromium sans interface" -#: agenda_culturel/models.py:851 +#: agenda_culturel/models.py:879 msgid "daily" msgstr "chaque jour" -#: agenda_culturel/models.py:852 +#: agenda_culturel/models.py:880 msgid "weekly" msgstr "chaque semaine" -#: agenda_culturel/models.py:854 +#: agenda_culturel/models.py:882 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:855 +#: agenda_culturel/models.py:883 msgid "Processor" msgstr "Processeur" -#: agenda_culturel/models.py:856 +#: agenda_culturel/models.py:884 msgid "Downloader" msgstr "Téléchargeur" -#: agenda_culturel/models.py:858 +#: agenda_culturel/models.py:886 msgid "Import recurrence" msgstr "Récurrence d'import" -#: agenda_culturel/models.py:861 +#: agenda_culturel/models.py:889 msgid "Source" msgstr "Source" -#: agenda_culturel/models.py:861 +#: agenda_culturel/models.py:889 msgid "URL of the source document" msgstr "URL du document source" -#: agenda_culturel/models.py:862 +#: agenda_culturel/models.py:890 msgid "Browsable url" msgstr "URL navigable" -#: agenda_culturel/models.py:862 +#: agenda_culturel/models.py:890 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:864 +#: agenda_culturel/models.py:892 msgid "Status of each imported event (published or draft)" msgstr "Status de chaque événement importé (publié ou brouillon)" -#: agenda_culturel/models.py:865 +#: agenda_culturel/models.py:893 msgid "Address for each imported event" msgstr "Adresse de chaque événement importé" -#: agenda_culturel/models.py:866 +#: agenda_culturel/models.py:894 msgid "Category of each imported event" msgstr "Catégorie de chaque événement importé" -#: agenda_culturel/models.py:867 +#: agenda_culturel/models.py:895 msgid "Tags for each imported event" msgstr "Étiquettes de chaque événement importé" -#: agenda_culturel/models.py:867 +#: agenda_culturel/models.py:895 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:886 +#: agenda_culturel/models.py:914 msgid "Running" msgstr "En cours" -#: agenda_culturel/models.py:887 +#: agenda_culturel/models.py:915 msgid "Canceled" msgstr "Annulé" -#: agenda_culturel/models.py:888 +#: agenda_culturel/models.py:916 msgid "Success" msgstr "Succès" -#: agenda_culturel/models.py:889 +#: agenda_culturel/models.py:917 msgid "Failed" msgstr "Erreur" -#: agenda_culturel/models.py:892 +#: agenda_culturel/models.py:920 msgid "Batch importation" msgstr "Importation par lot" -#: agenda_culturel/models.py:893 +#: agenda_culturel/models.py:921 msgid "Batch importations" msgstr "Importations par lot" -#: agenda_culturel/models.py:899 +#: agenda_culturel/models.py:927 msgid "Reference to the recurrent import processing" msgstr "Référence du processus d'import récurrent" -#: agenda_culturel/models.py:903 +#: agenda_culturel/models.py:931 msgid "Error message" msgstr "Votre message" -#: agenda_culturel/models.py:905 +#: agenda_culturel/models.py:933 msgid "Number of collected events" msgstr "Nombre d'événements collectés" -#: agenda_culturel/models.py:906 +#: agenda_culturel/models.py:934 msgid "Number of imported events" msgstr "Nombre d'événements importés" -#: agenda_culturel/models.py:907 +#: agenda_culturel/models.py:935 msgid "Number of updated events" msgstr "Nombre d'événements mis à jour" -#: agenda_culturel/models.py:908 +#: agenda_culturel/models.py:936 msgid "Number of removed events" msgstr "Nombre d'événements supprimés" -#: agenda_culturel/models.py:915 +#: agenda_culturel/models.py:943 msgid "Weight" msgstr "Poids" -#: agenda_culturel/models.py:915 +#: agenda_culturel/models.py:943 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:917 +#: agenda_culturel/models.py:945 msgid "Category applied to the event" msgstr "Catégorie appliquée à l'événement" -#: agenda_culturel/models.py:919 +#: agenda_culturel/models.py:947 msgid "Contained in the title" msgstr "Contenu dans le titre" -#: agenda_culturel/models.py:919 +#: agenda_culturel/models.py:947 msgid "Text contained in the event title" msgstr "Texte contenu dans le titre de l'événement" -#: agenda_culturel/models.py:920 +#: agenda_culturel/models.py:948 msgid "Exact title extract" msgstr "Extrait exact du titre" -#: agenda_culturel/models.py:920 +#: agenda_culturel/models.py:948 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:922 +#: agenda_culturel/models.py:950 msgid "Contained in the description" msgstr "Contenu dans la description" -#: agenda_culturel/models.py:922 +#: agenda_culturel/models.py:950 msgid "Text contained in the description" msgstr "Texte contenu dans la description" -#: agenda_culturel/models.py:923 +#: agenda_culturel/models.py:951 msgid "Exact description extract" msgstr "Extrait exact de description" -#: agenda_culturel/models.py:923 +#: agenda_culturel/models.py:951 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:925 +#: agenda_culturel/models.py:953 msgid "Contained in the location" msgstr "Contenu dans la localisation" -#: agenda_culturel/models.py:925 +#: agenda_culturel/models.py:953 msgid "Text contained in the event location" msgstr "Texte contenu dans la localisation de l'événement" -#: agenda_culturel/models.py:926 +#: agenda_culturel/models.py:954 msgid "Exact location extract" msgstr "Extrait exact de localisation" -#: agenda_culturel/models.py:926 +#: agenda_culturel/models.py:954 msgid "" "If checked, the extract will be searched for in the location using the exact " "form (capitals, accents)." @@ -580,52 +580,52 @@ msgstr "" "Si coché, l'extrait sera recherché dans la localisation en utilisant la " "forme exacte (majuscules, accents)" -#: agenda_culturel/models.py:929 +#: agenda_culturel/models.py:957 msgid "Categorisation rule" msgstr "Règle de catégorisation" -#: agenda_culturel/models.py:930 +#: agenda_culturel/models.py:958 msgid "Categorisation rules" msgstr "Règles de catégorisation" -#: agenda_culturel/models.py:986 agenda_culturel/models.py:1007 +#: agenda_culturel/models.py:1014 agenda_culturel/models.py:1035 msgid "Question" msgstr "Question" -#: agenda_culturel/models.py:986 agenda_culturel/models.py:1009 +#: agenda_culturel/models.py:1014 agenda_culturel/models.py:1037 msgid "Text that will be shown to moderators" msgstr "Text tel que présenté aux modérateurices" -#: agenda_culturel/models.py:989 +#: agenda_culturel/models.py:1017 msgid "Moderation question" msgstr "Question de modération" -#: agenda_culturel/models.py:990 +#: agenda_culturel/models.py:1018 msgid "Moderation questions" msgstr "Questions de modération" -#: agenda_culturel/models.py:1007 +#: agenda_culturel/models.py:1035 msgid "Associated question from moderation" msgstr "Question associée pour la modération" -#: agenda_culturel/models.py:1009 +#: agenda_culturel/models.py:1037 msgid "Answer" msgstr "Réponse" -#: agenda_culturel/models.py:1011 +#: agenda_culturel/models.py:1039 msgid "Adds tags" msgstr "Ajoute les étiquettes" -#: agenda_culturel/models.py:1011 +#: agenda_culturel/models.py:1039 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:1012 +#: agenda_culturel/models.py:1040 msgid "Removes tags" msgstr "Retire les étiquettes" -#: agenda_culturel/models.py:1012 +#: agenda_culturel/models.py:1040 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." @@ -735,15 +735,19 @@ msgstr "L'import récurrent a été supprimé avec succès" msgid "The import has been launched." msgstr "L'import a été lancé" -#: agenda_culturel/views.py:799 +#: agenda_culturel/views.py:753 +msgid "Imports has been launched." +msgstr "Les imports ont été lancés" + +#: agenda_culturel/views.py:814 msgid "The merge has been successfully completed." msgstr "La fusion a été réalisée avec succès." -#: agenda_culturel/views.py:829 +#: agenda_culturel/views.py:844 msgid "Events have been marked as unduplicated." msgstr "Les événements ont été marqués comme non dupliqués." -#: agenda_culturel/views.py:846 +#: agenda_culturel/views.py:861 msgid "" "The selected event has been retained, while the other has been moved to the " "recycle bin." @@ -751,7 +755,7 @@ msgstr "" "L'événement sélectionné a été conservé, l'autre a été déplacé dans la " "corbeille." -#: agenda_culturel/views.py:848 +#: agenda_culturel/views.py:863 msgid "" "The selected event has been retained, while the others have been moved to " "the recycle bin." @@ -759,19 +763,19 @@ msgstr "" "L'événement sélectionné a été conservé, les autres ont été déplacés dans la " "corbeille." -#: agenda_culturel/views.py:854 +#: agenda_culturel/views.py:869 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:877 +#: agenda_culturel/views.py:893 msgid "Cleaning up duplicates: {} item(s) removed." msgstr "Nettoyage des dupliqués: {} élément(s) supprimés." -#: agenda_culturel/views.py:905 +#: agenda_culturel/views.py:921 msgid "The event was successfully duplicated." msgstr "L'événement a été marqué dupliqué avec succès." -#: agenda_culturel/views.py:908 +#: agenda_culturel/views.py:924 msgid "" "The event has been successfully flagged as a duplicate. The moderation team " "will deal with your suggestion shortly." @@ -779,63 +783,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:947 +#: agenda_culturel/views.py:963 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:954 +#: agenda_culturel/views.py:970 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:974 agenda_culturel/views.py:1003 +#: agenda_culturel/views.py:990 agenda_culturel/views.py:1019 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:976 agenda_culturel/views.py:1005 +#: agenda_culturel/views.py:992 agenda_culturel/views.py:1021 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:978 agenda_culturel/views.py:1007 +#: agenda_culturel/views.py:994 agenda_culturel/views.py:1023 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:1035 +#: agenda_culturel/views.py:1051 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:1116 agenda_culturel/views.py:1172 -#: agenda_culturel/views.py:1201 +#: agenda_culturel/views.py:1132 agenda_culturel/views.py:1188 +#: agenda_culturel/views.py:1217 msgid "{} events have been updated." msgstr "{} événements ont été mis à jour." -#: agenda_culturel/views.py:1118 agenda_culturel/views.py:1174 -#: agenda_culturel/views.py:1203 +#: agenda_culturel/views.py:1134 agenda_culturel/views.py:1190 +#: agenda_culturel/views.py:1219 msgid "1 event has been updated." msgstr "1 événement a été mis à jour" -#: agenda_culturel/views.py:1120 agenda_culturel/views.py:1176 -#: agenda_culturel/views.py:1205 +#: agenda_culturel/views.py:1136 agenda_culturel/views.py:1192 +#: agenda_culturel/views.py:1221 msgid "No events have been modified." msgstr "Aucun événement n'a été modifié." -#: agenda_culturel/views.py:1128 +#: agenda_culturel/views.py:1144 msgid "The place has been successfully updated." msgstr "Le lieu a été modifié avec succès." -#: agenda_culturel/views.py:1135 +#: agenda_culturel/views.py:1151 msgid "The place has been successfully created." msgstr "Le lieu a été créé avec succès." -#: agenda_culturel/views.py:1194 +#: agenda_culturel/views.py:1210 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:1196 +#: agenda_culturel/views.py:1212 msgid "A new alias has been added to the selected place." msgstr "Un nouvel alias a été créé pour le lieu sélectionné." diff --git a/src/agenda_culturel/templates/agenda_culturel/rimports.html b/src/agenda_culturel/templates/agenda_culturel/rimports.html index 9c2156d..fbf0311 100644 --- a/src/agenda_culturel/templates/agenda_culturel/rimports.html +++ b/src/agenda_culturel/templates/agenda_culturel/rimports.html @@ -12,7 +12,10 @@
- Ajouter {% picto_from_name "plus-circle" %} +

Importations récurrentes

diff --git a/src/agenda_culturel/templates/agenda_culturel/run_all_rimports_confirm.html b/src/agenda_culturel/templates/agenda_culturel/run_all_rimports_confirm.html new file mode 100644 index 0000000..e2035ae --- /dev/null +++ b/src/agenda_culturel/templates/agenda_culturel/run_all_rimports_confirm.html @@ -0,0 +1,25 @@ +{% extends "agenda_culturel/page.html" %} + +{% block title %}Lancer tous les imports{% endblock %} + + +{% block content %} + +
+
+

Lancement de tous les imports

+
+
{% csrf_token %} +

Êtes-vous sûr·e de vouloir lancer tous les imports récurrent ?

+ {{ form }} + + +
+
+ +{% endblock %} \ No newline at end of file diff --git a/src/agenda_culturel/urls.py b/src/agenda_culturel/urls.py index b4ed79f..f897e87 100644 --- a/src/agenda_culturel/urls.py +++ b/src/agenda_culturel/urls.py @@ -43,6 +43,7 @@ urlpatterns = [ path("imports/add", add_import, name="add_import"), path("imports//cancel", cancel_import, name="cancel_import"), path("rimports/", recurrent_imports, name="recurrent_imports"), + path("rimports/run", run_all_rimports, name="run_all_rimports"), path("rimports/add", RecurrentImportCreateView.as_view(), name="add_rimport"), path("rimports//view", view_rimport, name="view_rimport"), path("rimports//edit", RecurrentImportUpdateView.as_view(), name="edit_rimport"), diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 0f9a1b9..8509a1f 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -36,7 +36,7 @@ from .import_tasks.importer import URL2Events from .import_tasks.extractor import Extractor from .import_tasks.downloader import ChromiumHeadlessDownloader -from .celery import app as celery_app, import_events_from_json, run_recurrent_import +from .celery import app as celery_app, import_events_from_json, run_recurrent_import, run_all_recurrent_imports import unicodedata import logging @@ -741,6 +741,21 @@ def run_rimport(request, pk): else: return render(request, 'agenda_culturel/run_rimport_confirm.html', {"object": rimport }) + +@login_required(login_url="/accounts/login/") +@permission_required(['agenda_culturel.view_recurrentimport', 'agenda_culturel.run_recurrentimport']) +def run_all_rimports(request): + if request.method == 'POST': + + # run recurrent import + result = run_all_recurrent_imports.delay() + + messages.success(request, _("Imports has been launched.")) + return HttpResponseRedirect(reverse_lazy("recurrent_imports")) + else: + return render(request, 'agenda_culturel/run_all_rimports_confirm.html') + + ######################### ## duplicated events #########################