From aa949f84b2a9c6914c8c4be8e69909df4ff2165b Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Sun, 7 Feb 2021 00:59:09 +0100 Subject: [PATCH] De retour pour les u-strings --- .../management/commands/nettoie_lieux.py | 6 ++--- .../management/commands/nettoie_stages.py | 2 +- .../management/commands/supprime_lieu.py | 2 +- .../management/commands/termine_scolarite.py | 2 +- avisstage/statics.py | 26 +++++++++---------- avisstage/templatetags/avisstage_tags.py | 6 ++--- avisstage/views_search.py | 18 ++++++------- avisstage/widgets.py | 4 +-- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/avisstage/management/commands/nettoie_lieux.py b/avisstage/management/commands/nettoie_lieux.py index 027ac78..8c6e6d1 100644 --- a/avisstage/management/commands/nettoie_lieux.py +++ b/avisstage/management/commands/nettoie_lieux.py @@ -46,7 +46,7 @@ class Command(BaseCommand): and plieu.ville == lieu.ville and plieu.type_lieu == lieu.type_lieu ): - print("%s %s" % (pprint, self.style.SUCCESS(u"-> Suppression"))) + print("%s %s" % (pprint, self.style.SUCCESS("-> Suppression"))) if rundb: for avis in plieu.avislieu_set.all(): avis.lieu = lieu @@ -55,6 +55,6 @@ class Command(BaseCommand): else: print( "%s %s" - % (pprint, self.style.WARNING(u"-> À supprimer manuellement")) + % (pprint, self.style.WARNING("-> À supprimer manuellement")) ) - self.stdout.write(self.style.SUCCESS(u"Nettoyage des lieux effectué")) + self.stdout.write(self.style.SUCCESS("Nettoyage des lieux effectué")) diff --git a/avisstage/management/commands/nettoie_stages.py b/avisstage/management/commands/nettoie_stages.py index e2a6640..95080a3 100644 --- a/avisstage/management/commands/nettoie_stages.py +++ b/avisstage/management/commands/nettoie_stages.py @@ -69,4 +69,4 @@ class Command(BaseCommand): ) for avis, alen in problems: print(" > Avis sur %s de %d mots" % (avis.lieu, alen)) - self.stdout.write(self.style.SUCCESS(u"Nettoyage des stages effectué")) + self.stdout.write(self.style.SUCCESS("Nettoyage des stages effectué")) diff --git a/avisstage/management/commands/supprime_lieu.py b/avisstage/management/commands/supprime_lieu.py index 2ebde67..9a3a490 100644 --- a/avisstage/management/commands/supprime_lieu.py +++ b/avisstage/management/commands/supprime_lieu.py @@ -39,4 +39,4 @@ class Command(BaseCommand): avis.lieu = lieu avis.save() plieu.delete() - self.stdout.write(self.style.SUCCESS(u"Terminé")) + self.stdout.write(self.style.SUCCESS("Terminé")) diff --git a/avisstage/management/commands/termine_scolarite.py b/avisstage/management/commands/termine_scolarite.py index 41f489a..71a15ed 100644 --- a/avisstage/management/commands/termine_scolarite.py +++ b/avisstage/management/commands/termine_scolarite.py @@ -15,4 +15,4 @@ class Command(BaseCommand): def handle(self, *args, **options): old_conn = timezone.now() - timedelta(days=365) Normalien.objects.all().update(last_cas_connect=t) - self.stdout.write(self.style.SUCCESS(u"Terminé")) + self.stdout.write(self.style.SUCCESS("Terminé")) diff --git a/avisstage/statics.py b/avisstage/statics.py index 76858a3..5344e8b 100644 --- a/avisstage/statics.py +++ b/avisstage/statics.py @@ -1,19 +1,19 @@ DEPARTEMENTS_DEFAUT = ( - ("phy", u"Physique"), - ("maths", u"Maths"), - ("bio", u"Biologie"), - ("chimie", u"Chimie"), - ("geol", u"Géosciences"), - ("dec", u"DEC"), - ("info", u"Informatique"), - ("litt", u"Littéraire"), - ("guests", u"Pensionnaires étrangers"), - ("pei", u"PEI"), + ("phy", "Physique"), + ("maths", "Maths"), + ("bio", "Biologie"), + ("chimie", "Chimie"), + ("geol", "Géosciences"), + ("dec", "DEC"), + ("info", "Informatique"), + ("litt", "Littéraire"), + ("guests", "Pensionnaires étrangers"), + ("pei", "PEI"), ) TYPE_STAGE_OPTIONS = ( ( - u"Recherche :", + "Recherche :", ( ("recherche", "Stage académique"), ("recherche_autre", "Stage non-académique"), @@ -21,14 +21,14 @@ TYPE_STAGE_OPTIONS = ( ), ), ( - u"Stage sans visée de recherche :", + "Stage sans visée de recherche :", ( ("pro", "Stage en entreprise"), ("admin", "Stage en admin./ONG/orga. internationale"), ), ), ( - u"Enseignement :", + "Enseignement :", ( ("lectorat", "Lectorat DRI"), ("autre_teach", "Autre expérience d'enseignement"), diff --git a/avisstage/templatetags/avisstage_tags.py b/avisstage/templatetags/avisstage_tags.py index f95217f..6da134b 100644 --- a/avisstage/templatetags/avisstage_tags.py +++ b/avisstage/templatetags/avisstage_tags.py @@ -21,9 +21,9 @@ def feedback_widget(): @register.filter def typonazisme(value): - value = re.sub(r"(\w)\s*([?!:])", u"\\1 \\2", value) - value = re.sub(r"(\w)\s*([,.])", u"\\1\\2", value) - value = re.sub(r"([?!:,.])(\w)", u"\\1 \\2", value) + value = re.sub(r"(\w)\s*([?!:])", "\\1 \\2", value) + value = re.sub(r"(\w)\s*([,.])", "\\1\\2", value) + value = re.sub(r"([?!:,.])(\w)", "\\1 \\2", value) return value diff --git a/avisstage/views_search.py b/avisstage/views_search.py index af95b2e..5f4289a 100644 --- a/avisstage/views_search.py +++ b/avisstage/views_search.py @@ -25,33 +25,33 @@ logger = logging.getLogger("recherche") # Recherche class SearchForm(forms.Form): generique = forms.CharField(required=False) - sujet = forms.CharField(label=u"À propos de", required=False) + sujet = forms.CharField(label="À propos de", required=False) contexte = forms.CharField( - label=u"Contexte (lieu, encadrant⋅e⋅s, structure)", required=False + label="Contexte (lieu, encadrant⋅e⋅s, structure)", required=False ) - apres_annee = forms.IntegerField(label=u"Après cette année", required=False) - avant_annee = forms.IntegerField(label=u"Avant cette année", required=False) + apres_annee = forms.IntegerField(label="Après cette année", required=False) + avant_annee = forms.IntegerField(label="Avant cette année", required=False) type_stage = forms.ChoiceField( label="Type de stage", - choices=([("", u"")] + list(TYPE_STAGE_OPTIONS)), + choices=([("", "")] + list(TYPE_STAGE_OPTIONS)), required=False, ) niveau_scol = forms.ChoiceField( label="Année d'étude", - choices=([("", u"")] + list(NIVEAU_SCOL_OPTIONS)), + choices=([("", "")] + list(NIVEAU_SCOL_OPTIONS)), required=False, ) type_lieu = forms.ChoiceField( label="Type de lieu d'accueil", - choices=([("", u"")] + list(TYPE_LIEU_OPTIONS)), + choices=([("", "")] + list(TYPE_LIEU_OPTIONS)), required=False, ) tri = forms.ChoiceField( - label=u"Tri par", - choices=[("pertinence", u"Pertinence"), ("-date_maj", u"Dernière mise à jour")], + label="Tri par", + choices=[("pertinence", "Pertinence"), ("-date_maj", "Dernière mise à jour")], required=False, initial="pertinence", ) diff --git a/avisstage/widgets.py b/avisstage/widgets.py index e3487d6..3b332e9 100644 --- a/avisstage/widgets.py +++ b/avisstage/widgets.py @@ -23,8 +23,8 @@ class LatLonField(forms.MultiValueField): srid = 4326 default_error_messages = { - "invalid_latitude": (u"Entrez une latitude valide."), - "invalid_longitude": (u"Entrez une longitude valide."), + "invalid_latitude": ("Entrez une latitude valide."), + "invalid_longitude": ("Entrez une longitude valide."), } def __init__(self, *args, **kwargs):