From 61bba4152ce04e9117ed39d9aba8ece88cd36ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Wed, 1 Dec 2021 12:50:00 +0100 Subject: [PATCH] Flash message for registration page when user is logged in --- canaille/account.py | 4 ++ .../translations/fr/LC_MESSAGES/messages.mo | Bin 20110 -> 20250 bytes .../translations/fr/LC_MESSAGES/messages.po | 38 ++++++++++-------- canaille/translations/messages.pot | 36 +++++++++-------- 4 files changed, 45 insertions(+), 33 deletions(-) diff --git a/canaille/account.py b/canaille/account.py index a9c102d5..8f70a503 100644 --- a/canaille/account.py +++ b/canaille/account.py @@ -221,6 +221,10 @@ def registration(data, hash): return redirect(url_for("account.index")) if current_user(): + flash( + _("You are already logged in, you cannot create an account."), + "error", + ) return redirect(url_for("account.index")) if hash != profile_hash(*data): diff --git a/canaille/translations/fr/LC_MESSAGES/messages.mo b/canaille/translations/fr/LC_MESSAGES/messages.mo index 58d18e3d3fcb7822f000bbfb9501f2a51fb18262..975281ebda4c516d1fbb1dfb5e0dadc5a3b67bdb 100644 GIT binary patch delta 3597 zcmYM$c~DkW7{~Dk0f|U+Ap_j51W1S^qJktUkV~%Fq-Nz5!mFh6Lh_=alUFlKqjAcm z&81BLP$y{`vaD%F8_LG~!)!=rO35WHEn93cEwS&fduC$L&pGGbd+vFj=bWo+Hb=d> zCCYE@60^bhY2i-~{(RV8z5jn6>R@(&?o8|wWtP^_Y&ZSSQ*S>xG@o zV(72vVwQlbum;!Te2ndCHU}4AxtVWY(O^y+o@l0bPekUj`A#CNU@I2lckX&>QZSx{%0wP2vjx}_r{VytmAv1!)6j%pIy~l!Z~;02kg!G6=!lv&>xD* z#0=B~52H#^<*Y|7d?hNNmr?icN0sUT>i#3BlAlN+|772ObOX`dgNeH!OC3n5er=bbsdj+-ah>Ey7 zD$-Qc1i7e`7NR1bh3q$b9B;?xk!slosOMVH!!yW1uo&t&29r^Hs0_7WKTIQ=Mg+Cu zt*8~giF(0aRH{BlW$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--git a/canaille/translations/fr/LC_MESSAGES/messages.po b/canaille/translations/fr/LC_MESSAGES/messages.po index 60bf7b36..7a635e25 100644 --- a/canaille/translations/fr/LC_MESSAGES/messages.po +++ b/canaille/translations/fr/LC_MESSAGES/messages.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: contact@yaal.fr\n" -"POT-Creation-Date: 2021-12-01 12:34+0100\n" -"PO-Revision-Date: 2021-12-01 12:35+0100\n" +"POT-Creation-Date: 2021-12-01 12:48+0100\n" +"PO-Revision-Date: 2021-12-01 12:48+0100\n" "Last-Translator: Camille \n" "Language: fr\n" "Language-Team: French \n" @@ -47,7 +47,7 @@ msgstr "" "Un lien d'initialisation de votre mot de passe vous a été envoyé par mail. " "Vous devriez le recevoir d'ici une dizaine de minutes." -#: canaille/account.py:137 canaille/account.py:319 +#: canaille/account.py:137 canaille/account.py:323 msgid "Could not send the password initialization email" msgstr "Impossible d'envoyer le courriel d'initialisation de mot de passe." @@ -55,11 +55,11 @@ msgstr "Impossible d'envoyer le courriel d'initialisation de mot de passe." msgid "An error happened whilen sending the invitation link." msgstr "Une erreur est survenue durant l'envoi du lien d'invitation" -#: canaille/account.py:190 canaille/account.py:260 +#: canaille/account.py:190 canaille/account.py:264 msgid "User account creation failed." msgstr "La création du compte utilisateur a échoué." -#: canaille/account.py:211 canaille/account.py:228 +#: canaille/account.py:211 canaille/account.py:232 msgid "The invitation link that brought you here was invalid." msgstr "Le lien d'invitation qui vous a amené ici est invalide." @@ -67,11 +67,15 @@ msgstr "Le lien d'invitation qui vous a amené ici est invalide." msgid "Your account has already been created." msgstr "Votre compte a déjà été créé." -#: canaille/account.py:291 +#: canaille/account.py:225 +msgid "You are already logged in, you cannot create an account." +msgstr "Vous êtes déjà connectés, vous ne pouvez pas créer de compte." + +#: canaille/account.py:295 msgid "User account creation succeed." msgstr "La création du compte utilisateur a réussi." -#: canaille/account.py:313 +#: canaille/account.py:317 msgid "" "A password initialization link has been sent at the user email address. It " "should be received within 10 minutes." @@ -79,7 +83,7 @@ msgstr "" "Un lien d'initialisation de mot de passe a été envoyé à l'utilisateur par " "mail. Il devrait arriver d'ici une dizaine de minutes." -#: canaille/account.py:327 +#: canaille/account.py:331 msgid "" "A password reset link has been sent at the user email address. It should be " "received within 10 minutes." @@ -87,28 +91,28 @@ msgstr "" "Un lien de réinitialisation de mot de passe a été envoyé à l'utilisateur par " "mail. Il devrait arriver d'ici une dizaine de minutes." -#: canaille/account.py:333 +#: canaille/account.py:337 msgid "Could not send the password reset email" msgstr "Impossible d'envoyer le lien de réinitialisation." -#: canaille/account.py:367 +#: canaille/account.py:371 msgid "Profile edition failed." msgstr "L'édition du profil a échoué." -#: canaille/account.py:390 +#: canaille/account.py:394 msgid "Profile updated successfuly." msgstr "Le profil a été mis à jour avec succès." -#: canaille/account.py:409 +#: canaille/account.py:413 #, python-format msgid "The user %(user)s has been sucessfuly deleted" msgstr "L'utilisateur %(user)s a bien été supprimé" -#: canaille/account.py:432 +#: canaille/account.py:436 msgid "Could not send the password reset link." msgstr "Impossible d'envoyer le lien de réinitialisation." -#: canaille/account.py:439 canaille/account.py:450 +#: canaille/account.py:443 canaille/account.py:454 msgid "" "A password reset link has been sent at your email address. You should " "receive it within 10 minutes." @@ -116,15 +120,15 @@ msgstr "" "Un lien de ré-initialisation de votre mot de passe vous a été envoyé par " "mail. Vous devriez le recevoir d'ici une dizaine de minutes." -#: canaille/account.py:456 +#: canaille/account.py:460 msgid "Could not reset your password" msgstr "Impossible de réinitialiser votre mot de passe" -#: canaille/account.py:470 +#: canaille/account.py:474 msgid "The password reset link that brought you here was invalid." msgstr "Le lien de réinitialisation qui vous a amené ici est invalide." -#: canaille/account.py:479 +#: canaille/account.py:483 msgid "Your password has been updated successfuly" msgstr "Votre mot de passe a correctement été mis à jour." diff --git a/canaille/translations/messages.pot b/canaille/translations/messages.pot index e0213e0f..d817c05c 100644 --- a/canaille/translations/messages.pot +++ b/canaille/translations/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2021-12-01 12:34+0100\n" +"POT-Creation-Date: 2021-12-01 12:48+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,7 +41,7 @@ msgid "" "should receive it within 10 minutes." msgstr "" -#: canaille/account.py:137 canaille/account.py:319 +#: canaille/account.py:137 canaille/account.py:323 msgid "Could not send the password initialization email" msgstr "" @@ -49,11 +49,11 @@ msgstr "" msgid "An error happened whilen sending the invitation link." msgstr "" -#: canaille/account.py:190 canaille/account.py:260 +#: canaille/account.py:190 canaille/account.py:264 msgid "User account creation failed." msgstr "" -#: canaille/account.py:211 canaille/account.py:228 +#: canaille/account.py:211 canaille/account.py:232 msgid "The invitation link that brought you here was invalid." msgstr "" @@ -61,58 +61,62 @@ msgstr "" msgid "Your account has already been created." msgstr "" -#: canaille/account.py:291 +#: canaille/account.py:225 +msgid "You are already logged in, you cannot create an account." +msgstr "" + +#: canaille/account.py:295 msgid "User account creation succeed." msgstr "" -#: canaille/account.py:313 +#: canaille/account.py:317 msgid "" "A password initialization link has been sent at the user email address. " "It should be received within 10 minutes." msgstr "" -#: canaille/account.py:327 +#: canaille/account.py:331 msgid "" "A password reset link has been sent at the user email address. It should " "be received within 10 minutes." msgstr "" -#: canaille/account.py:333 +#: canaille/account.py:337 msgid "Could not send the password reset email" msgstr "" -#: canaille/account.py:367 +#: canaille/account.py:371 msgid "Profile edition failed." msgstr "" -#: canaille/account.py:390 +#: canaille/account.py:394 msgid "Profile updated successfuly." msgstr "" -#: canaille/account.py:409 +#: canaille/account.py:413 #, python-format msgid "The user %(user)s has been sucessfuly deleted" msgstr "" -#: canaille/account.py:432 +#: canaille/account.py:436 msgid "Could not send the password reset link." msgstr "" -#: canaille/account.py:439 canaille/account.py:450 +#: canaille/account.py:443 canaille/account.py:454 msgid "" "A password reset link has been sent at your email address. You should " "receive it within 10 minutes." msgstr "" -#: canaille/account.py:456 +#: canaille/account.py:460 msgid "Could not reset your password" msgstr "" -#: canaille/account.py:470 +#: canaille/account.py:474 msgid "The password reset link that brought you here was invalid." msgstr "" -#: canaille/account.py:479 +#: canaille/account.py:483 msgid "Your password has been updated successfuly" msgstr ""