Mesage de succès sur la création d'un compte

This commit is contained in:
Tom Hubrecht 2021-08-24 23:15:10 +02:00
parent 064c5578c8
commit cd95f2c1e4
3 changed files with 154 additions and 143 deletions

View file

@ -60,17 +60,17 @@ class AdminPanelView(StaffMemberMixin, TemplateView):
# ############################################################################# # #############################################################################
class CreatePwdAccount(StaffMemberMixin, CreateView): class CreatePwdAccount(StaffMemberMixin, SuccessMessageMixin, CreateView):
model = User model = User
form_class = PwdUserForm form_class = PwdUserForm
template_name = "auth/create-user.html" template_name = "auth/create-user.html"
success_url = reverse_lazy("auth.create-account") success_url = reverse_lazy("auth.admin")
success_message = _("Compte créé avec succès")
def form_valid(self, form): def form_valid(self, form):
# On enregistre un mot de passe aléatoire # On enregistre un mot de passe aléatoire
form.instance.password = make_password(generate_password(32)) form.instance.password = make_password(generate_password(32))
# On envoie un mail pour réinitialiser le mot de passe
return super().form_valid(form) return super().form_valid(form)

View file

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.1\n" "Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-08-23 01:18+0200\n" "POT-Creation-Date: 2021-08-24 23:14+0200\n"
"PO-Revision-Date: 2021-08-23 01:19+0200\n" "PO-Revision-Date: 2021-08-24 23:14+0200\n"
"Last-Translator: Test Translator <test@translator>\n" "Last-Translator: Test Translator <test@translator>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: en\n" "Language: en\n"
@ -59,8 +59,8 @@ msgid "Supprimer le vote de {} ({}) ?"
msgstr "Delete the vote of {} ({}) ?" msgstr "Delete the vote of {} ({}) ?"
#: elections/forms.py:118 elections/templates/elections/admin/option.html:6 #: elections/forms.py:118 elections/templates/elections/admin/option.html:6
#: elections/templates/elections/admin/question.html:23 #: elections/templates/elections/admin/question.html:20
#: elections/templates/elections/election_voters.html:61 #: elections/templates/elections/election_voters.html:110
msgid "Supprimer" msgid "Supprimer"
msgstr "Delete" msgstr "Delete"
@ -225,8 +225,8 @@ msgstr ""
"automatically." "automatically."
#: elections/templates/elections/admin/option.html:12 #: elections/templates/elections/admin/option.html:12
#: elections/templates/elections/admin/question.html:32 #: elections/templates/elections/admin/question.html:29
#: elections/templates/elections/election_admin.html:157 #: elections/templates/elections/election_admin.html:156
#: faqs/templates/faqs/faq.html:22 #: faqs/templates/faqs/faq.html:22
msgid "Modifier" msgid "Modifier"
msgstr "Edit" msgstr "Edit"
@ -235,13 +235,13 @@ msgstr "Edit"
msgid "Modifier l'option" msgid "Modifier l'option"
msgstr "Change the option" msgstr "Change the option"
#: elections/templates/elections/admin/question.html:27 #: elections/templates/elections/admin/question.html:24
msgid "Modifier la question" msgid "Modifier la question"
msgstr "Change the question" msgstr "Change the question"
#: elections/templates/elections/admin/question.html:59
#: elections/templates/elections/admin/question.html:63 #: elections/templates/elections/admin/question.html:63
#: elections/templates/elections/admin/question.html:67 #: elections/templates/elections/election_admin.html:276
#: elections/templates/elections/election_admin.html:277
msgid "Rajouter une option" msgid "Rajouter une option"
msgstr "Add an option" msgstr "Add an option"
@ -249,51 +249,51 @@ msgstr "Add an option"
msgid "Supprimer un vote" msgid "Supprimer un vote"
msgstr "Delete a vote" msgstr "Delete a vote"
#: elections/templates/elections/election.html:20 #: elections/templates/elections/election.html:19
msgid "Votant·e·s"
msgstr "Voters"
#: elections/templates/elections/election.html:31
msgid "Bulletins"
msgstr "Ballots"
#: elections/templates/elections/election.html:41
msgid "Élection terminée" msgid "Élection terminée"
msgstr "Election completed" msgstr "Election completed"
#: elections/templates/elections/election.html:43 #: elections/templates/elections/election.html:21
msgid "Élection en cours" msgid "Élection en cours"
msgstr "Election in progress" msgstr "Election in progress"
#: elections/templates/elections/election.html:52 #: elections/templates/elections/election.html:45
#: elections/templates/elections/election_list.html:66 #: elections/templates/elections/election_list.html:64
msgid "Administrer" msgid "Administrer"
msgstr "Manage" msgstr "Manage"
#: elections/templates/elections/election.html:79 #: elections/templates/elections/election.html:56
msgid "Votant·e·s"
msgstr "Voters"
#: elections/templates/elections/election.html:65
msgid "Bulletins"
msgstr "Ballots"
#: elections/templates/elections/election.html:91
#, python-format #, python-format
msgid "Créé par %(creator)s" msgid "Créé par %(creator)s"
msgstr "Created by %(creator)s" msgstr "Created by %(creator)s"
#: elections/templates/elections/election.html:92 #: elections/templates/elections/election.html:104
msgid "Votre vote a bien été enregistré." msgid "Votre vote a bien été enregistré."
msgstr "Your vote has been recorded." msgstr "Your vote has been recorded."
#: elections/templates/elections/election.html:106 #: elections/templates/elections/election.html:117
#, python-format #, python-format
msgid "Dépouillé le %(timestamp)s" msgid "Dépouillé le %(timestamp)s"
msgstr "Counted on %(timestamp)s" msgstr "Counted on %(timestamp)s"
#: elections/templates/elections/election.html:115 #: elections/templates/elections/election.html:126
#, python-format #, python-format
msgid "Publié le %(timestamp)s" msgid "Publié le %(timestamp)s"
msgstr "Published on %(timestamp)s" msgstr "Published on %(timestamp)s"
#: elections/templates/elections/election.html:141 #: elections/templates/elections/election.html:152
msgid "Voter" msgid "Voter"
msgstr "Vote" msgstr "Vote"
#: elections/templates/elections/election.html:152 #: elections/templates/elections/election.html:163
msgid "" msgid ""
"Pour voter lors de cette élection, vous devez vous connecter à l'aide des " "Pour voter lors de cette élection, vous devez vous connecter à l'aide des "
"identifiants reçus par mail." "identifiants reçus par mail."
@ -301,8 +301,8 @@ msgstr ""
"To vote in this election, you must log in using the login credentials you " "To vote in this election, you must log in using the login credentials you "
"received by e-mail." "received by e-mail."
#: elections/templates/elections/election.html:154 #: elections/templates/elections/election.html:165
#: elections/templates/elections/election_voters.html:44 #: elections/templates/elections/election_voters.html:93
msgid "" msgid ""
"Pour voter lors de cette élection, vous devez vous connecter à l'aide du CAS " "Pour voter lors de cette élection, vous devez vous connecter à l'aide du CAS "
"élève, d'autres restrictions peuvent s'appliquer et votre vote pourra être " "élève, d'autres restrictions peuvent s'appliquer et votre vote pourra être "
@ -312,83 +312,83 @@ msgstr ""
"restrictions may apply and your vote may be deleted if you are not eligible " "restrictions may apply and your vote may be deleted if you are not eligible "
"to vote." "to vote."
#: elections/templates/elections/election.html:170 #: elections/templates/elections/election.html:181
msgid "Connexion par identifiants" msgid "Connexion par identifiants"
msgstr "Login with credentials" msgstr "Login with credentials"
#: elections/templates/elections/election.html:181 #: elections/templates/elections/election.html:192
#: shared/templates/authens/login_switch.html:20 #: shared/templates/authens/login_switch.html:20
msgid "Connexion via CAS" msgid "Connexion via CAS"
msgstr "Login via CAS" msgstr "Login via CAS"
#: elections/templates/elections/election.html:216 #: elections/templates/elections/election.html:227
msgid "A voté" msgid "A voté"
msgstr "Voted" msgstr "Voted"
#: elections/templates/elections/election_admin.html:95 #: elections/templates/elections/election_admin.html:94
#: elections/templates/elections/election_list.html:58 #: elections/templates/elections/election_list.html:58
msgid "Élection invisible" msgid "Élection invisible"
msgstr "Invisible election" msgstr "Invisible election"
#: elections/templates/elections/election_admin.html:102 #: elections/templates/elections/election_admin.html:101
msgid "Élection visible" msgid "Élection visible"
msgstr "Visible election" msgstr "Visible election"
#: elections/templates/elections/election_admin.html:116 #: elections/templates/elections/election_admin.html:115
msgid "Actions" msgid "Actions"
msgstr "Actions" msgstr "Actions"
#: elections/templates/elections/election_admin.html:128 #: elections/templates/elections/election_admin.html:127
msgid "Vue classique" msgid "Vue classique"
msgstr "Classic view" msgstr "Classic view"
#: elections/templates/elections/election_admin.html:139 #: elections/templates/elections/election_admin.html:138
msgid "Rendre l'élection visible" msgid "Rendre l'élection visible"
msgstr "Make the election visible" msgstr "Make the election visible"
#: elections/templates/elections/election_admin.html:148 #: elections/templates/elections/election_admin.html:147
msgid "Exporter les votant·e·s" msgid "Exporter les votant·e·s"
msgstr "Export the list of voters" msgstr "Export the list of voters"
#: elections/templates/elections/election_admin.html:166 #: elections/templates/elections/election_admin.html:165
#: elections/templates/elections/upload_voters.html:32 #: elections/templates/elections/election_upload_voters.html:32
msgid "Gestion de la liste de votant·e·s" msgid "Gestion de la liste de votant·e·s"
msgstr "Management of the voters' list" msgstr "Management of the voters' list"
#: elections/templates/elections/election_admin.html:178 #: elections/templates/elections/election_admin.html:177
#: elections/templates/elections/election_voters.html:27 #: elections/templates/elections/election_voters.html:76
msgid "Liste des votant·e·s" msgid "Liste des votant·e·s"
msgstr "Voters' list" msgstr "Voters' list"
#: elections/templates/elections/election_admin.html:186 #: elections/templates/elections/election_admin.html:185
msgid "Dépouiller" msgid "Dépouiller"
msgstr "Count" msgstr "Count"
#: elections/templates/elections/election_admin.html:198 #: elections/templates/elections/election_admin.html:197
msgid "Publier" msgid "Publier"
msgstr "Publish" msgstr "Publish"
#: elections/templates/elections/election_admin.html:200 #: elections/templates/elections/election_admin.html:199
msgid "Dépublier" msgid "Dépublier"
msgstr "De-publish" msgstr "De-publish"
#: elections/templates/elections/election_admin.html:210 #: elections/templates/elections/election_admin.html:209
msgid "Télécharger les résultats" msgid "Télécharger les résultats"
msgstr "Download the results" msgstr "Download the results"
#: elections/templates/elections/election_admin.html:219 #: elections/templates/elections/election_admin.html:218
msgid "Archiver" msgid "Archiver"
msgstr "Archive" msgstr "Archive"
#: elections/templates/elections/election_admin.html:281 #: elections/templates/elections/election_admin.html:280
#: elections/templates/elections/election_admin.html:286 #: elections/templates/elections/election_admin.html:285
#: elections/templates/elections/election_admin.html:290 #: elections/templates/elections/election_admin.html:289
msgid "Rajouter une question" msgid "Rajouter une question"
msgstr "Add a question" msgstr "Add a question"
#: elections/templates/elections/election_ballots.html:18 #: elections/templates/elections/election_ballots.html:18
#: elections/templates/elections/election_voters.html:19 #: elections/templates/elections/election_upload_voters.html:67
#: elections/templates/elections/upload_voters.html:71 #: elections/templates/elections/election_voters.html:68
#: elections/templates/elections/vote.html:49 #: elections/templates/elections/vote.html:49
#: shared/templates/auth/create-user.html:32 #: shared/templates/auth/create-user.html:32
#: shared/templates/auth/election_login.html:34 #: shared/templates/auth/election_login.html:34
@ -415,59 +415,33 @@ msgstr "List of elections"
msgid "Créer une élection" msgid "Créer une élection"
msgstr "Create an election" msgstr "Create an election"
#: elections/templates/elections/election_list.html:84 #: elections/templates/elections/election_list.html:94
#, python-format #, python-format
msgid "Élection dépouillée le %(timestamp)s" msgid "Élection dépouillée le %(timestamp)s"
msgstr "Election counted on %(timestamp)s" msgstr "Election counted on %(timestamp)s"
#: elections/templates/elections/election_list.html:86 #: elections/templates/elections/election_list.html:96
msgid "Élection dépouillée" msgid "Élection dépouillée"
msgstr "Election counted" msgstr "Election counted"
#: elections/templates/elections/election_list.html:94 #: elections/templates/elections/election_list.html:104
#, python-format #, python-format
msgid "Élection publiée le %(timestamp)s" msgid "Élection publiée le %(timestamp)s"
msgstr "Election published on %(timestamp)s" msgstr "Election published on %(timestamp)s"
#: elections/templates/elections/election_list.html:96 #: elections/templates/elections/election_list.html:106
msgid "Élection publiée" msgid "Élection publiée"
msgstr "Published election" msgstr "Published election"
#: elections/templates/elections/election_list.html:102 #: elections/templates/elections/election_list.html:112
msgid "Élection archivée" msgid "Élection archivée"
msgstr "Archived election" msgstr "Archived election"
#: elections/templates/elections/election_update.html:32 #: elections/templates/elections/election_mail_voters.html:7
msgid "Modification d'une élection"
msgstr "Editing an election"
#: elections/templates/elections/election_voters.html:42
msgid ""
"Seules les personnes présentes sur cette liste peuvent voter, vous avez dû "
"recevoir un mail avec vos identifiants de connexion."
msgstr ""
"Only people on this list can vote, you should have received an e-mail with "
"your login credentials."
#: elections/templates/elections/election_voters.html:58
#: elections/templates/elections/upload_voters.html:131
msgid "Nom"
msgstr "Name"
#: elections/templates/elections/election_voters.html:59
msgid "Vote enregistré"
msgstr "Recorded vote"
#: elections/templates/elections/election_voters.html:92
#, python-format
msgid "Supprimer le vote de %(v_name)s"
msgstr "Delete the vote of %(v_name)s"
#: elections/templates/elections/mail_voters.html:7
msgid "Composition du mail aux votant·e·s" msgid "Composition du mail aux votant·e·s"
msgstr "Composition of the e-mail to voters" msgstr "Composition of the e-mail to voters"
#: elections/templates/elections/mail_voters.html:12 #: elections/templates/elections/election_mail_voters.html:12
msgid "" msgid ""
"Assurez-vous que la liste des votant·e·s est complète, en effet, une fois le " "Assurez-vous que la liste des votant·e·s est complète, en effet, une fois le "
"mail envoyé, il ne sera plus possible de la modifier." "mail envoyé, il ne sera plus possible de la modifier."
@ -475,7 +449,7 @@ msgstr ""
"Make sure that the list of voters is complete, as once the e-mail is sent, " "Make sure that the list of voters is complete, as once the e-mail is sent, "
"it will not be possible to change it." "it will not be possible to change it."
#: elections/templates/elections/mail_voters.html:17 #: elections/templates/elections/election_mail_voters.html:17
#, python-brace-format #, python-brace-format
msgid "" msgid ""
"Rajoutez le message à envoyer aux électeurs entre 'Dear {full_name}' et " "Rajoutez le message à envoyer aux électeurs entre 'Dear {full_name}' et "
@ -484,17 +458,80 @@ msgstr ""
"Add the message to be sent to voters between 'Dear {full_name}' and the " "Add the message to be sent to voters between 'Dear {full_name}' and the "
"election url." "election url."
#: elections/templates/elections/mail_voters.html:22 #: elections/templates/elections/election_mail_voters.html:22
msgid "Envoyer" msgid "Envoyer"
msgstr "Send" msgstr "Send"
#: elections/templates/elections/option_update.html:13 #: elections/templates/elections/election_update.html:32
msgid "Modification d'une option" msgid "Modification d'une élection"
msgstr "Editing an option" msgstr "Editing an election"
#: elections/templates/elections/question_update.html:13 #: elections/templates/elections/election_upload_voters.html:43
msgid "Modification d'une question" #: elections/templates/elections/election_upload_voters.html:79
msgstr "Editing a question" msgid "Envoyer le mail d'annonce"
msgstr "Send the announcement e-mail"
#: elections/templates/elections/election_upload_voters.html:50
#: elections/templates/elections/election_upload_voters.html:86
msgid "Mail en cours de distribution"
msgstr "E-mail being distributed"
#: elections/templates/elections/election_upload_voters.html:57
#: elections/templates/elections/election_upload_voters.html:93
msgid "Mail envoyé"
msgstr "E-mail sent"
#: elections/templates/elections/election_upload_voters.html:103
msgid ""
"Importez un fichier au format CSV, avec sur la première colonne le login, "
"sur la deuxième, le nom et prénom et enfin l'adresse email sur la troisième. "
"Soit :<br><br><pre>Login_1,Prénom/Nom_1,mail_1@machin.test<br>Login_2,Prénom/"
"Nom_2,mail_2@bidule.test<br>...</pre>"
msgstr ""
"Import a file in CSV format, with the login in the first column, the first "
"and last name in the second and the e-mail address in the third. So:"
"<br><br><pre>Login_1,Firstname/Lastname_1,mail_1@thing.test<br>Login_2,"
"Firstname/Lastname_2,mail_2@thingy.test<br>...</pre>"
#: elections/templates/elections/election_upload_voters.html:129
msgid "Importer"
msgstr "Import"
#: elections/templates/elections/election_upload_voters.html:142
msgid "Liste des votant·e·s pour cette élection"
msgstr "List of voters for this election"
#: elections/templates/elections/election_upload_voters.html:151
msgid "Login"
msgstr "Login"
#: elections/templates/elections/election_upload_voters.html:152
#: elections/templates/elections/election_voters.html:107
msgid "Nom"
msgstr "Name"
#: elections/templates/elections/election_upload_voters.html:153
#: shared/auth/forms.py:73
msgid "Email"
msgstr "E-mail"
#: elections/templates/elections/election_voters.html:91
msgid ""
"Seules les personnes présentes sur cette liste peuvent voter, vous avez dû "
"recevoir un mail avec vos identifiants de connexion."
msgstr ""
"Only people on this list can vote, you should have received an e-mail with "
"your login credentials."
#: elections/templates/elections/election_voters.html:108
msgid "Vote enregistré"
msgstr "Recorded vote"
#: elections/templates/elections/election_voters.html:128
#: elections/templates/elections/election_voters.html:161
#, python-format
msgid "Supprimer le vote de %(v_name)s"
msgstr "Delete the vote of %(v_name)s"
#: elections/templates/elections/results/rank.html:38 #: elections/templates/elections/results/rank.html:38
#, python-format #, python-format
@ -516,46 +553,6 @@ msgstr ""
msgid "L'option majoritaire et gagnante est colorée en vert." msgid "L'option majoritaire et gagnante est colorée en vert."
msgstr "The dominant and winning option is coloured green." msgstr "The dominant and winning option is coloured green."
#: elections/templates/elections/upload_voters.html:43
msgid "Envoyer le mail d'annonce"
msgstr "Send the announcement e-mail"
#: elections/templates/elections/upload_voters.html:52
msgid "Mail en cours de distribution"
msgstr "E-mail being distributed"
#: elections/templates/elections/upload_voters.html:61
msgid "Mail envoyé"
msgstr "E-mail sent"
#: elections/templates/elections/upload_voters.html:82
msgid ""
"Importez un fichier au format CSV, avec sur la première colonne le login, "
"sur la deuxième, le nom et prénom et enfin l'adresse email sur la troisième. "
"Soit :<br><br><pre>Login_1,Prénom/Nom_1,mail_1@machin.test<br>Login_2,Prénom/"
"Nom_2,mail_2@bidule.test<br>...</pre>"
msgstr ""
"Import a file in CSV format, with the login in the first column, the first "
"and last name in the second and the e-mail address in the third. So:"
"<br><br><pre>Login_1,Firstname/Lastname_1,mail_1@thing.test<br>Login_2,"
"Firstname/Lastname_2,mail_2@thingy.test<br>...</pre>"
#: elections/templates/elections/upload_voters.html:108
msgid "Importer"
msgstr "Import"
#: elections/templates/elections/upload_voters.html:121
msgid "Liste des votant·e·s pour cette élection"
msgstr "List of voters for this election"
#: elections/templates/elections/upload_voters.html:130
msgid "Login"
msgstr "Login"
#: elections/templates/elections/upload_voters.html:132 shared/auth/forms.py:73
msgid "Email"
msgstr "E-mail"
#: elections/templates/elections/vote.html:15 #: elections/templates/elections/vote.html:15
msgid "Vote pour la question :" msgid "Vote pour la question :"
msgstr "Vote for the question:" msgstr "Vote for the question:"
@ -678,31 +675,35 @@ msgstr "Announcement e-mail being distributed!"
msgid "Élection modifiée avec succès !" msgid "Élection modifiée avec succès !"
msgstr "Election successfully modified!" msgstr "Election successfully modified!"
#: elections/views.py:280 #: elections/views.py:222
msgid "Vote de {} supprimé !"
msgstr "{}'s vote deleted!"
#: elections/views.py:256
msgid "Élection dépouillée avec succès !" msgid "Élection dépouillée avec succès !"
msgstr "Election successfully counted!" msgstr "Election successfully counted!"
#: elections/views.py:307 #: elections/views.py:283
msgid "Élection publiée avec succès !" msgid "Élection publiée avec succès !"
msgstr "Election successfully published!" msgstr "Election successfully published!"
#: elections/views.py:308 #: elections/views.py:284
msgid "Élection dépubliée avec succès !" msgid "Élection dépubliée avec succès !"
msgstr "Election successfully de-published!" msgstr "Election successfully de-published!"
#: elections/views.py:339 #: elections/views.py:315
msgid "Élection archivée avec succès !" msgid "Élection archivée avec succès !"
msgstr "Election successfully archived!" msgstr "Election successfully archived!"
#: elections/views.py:373 #: elections/views.py:349
msgid "Question supprimée !" msgid "Question supprimée !"
msgstr "Question deleted!" msgstr "Question deleted!"
#: elections/views.py:401 #: elections/views.py:377
msgid "Option supprimée !" msgid "Option supprimée !"
msgstr "Option deleted!" msgstr "Option deleted!"
#: elections/views.py:546 #: elections/views.py:521
msgid "Votre choix a bien été enregistré !" msgid "Votre choix a bien été enregistré !"
msgstr "Your choice has been recorded!" msgstr "Your choice has been recorded!"
@ -802,6 +803,10 @@ msgstr "Invalid username format, only CAS or password accounts are editable"
msgid "Pas d'utilisateur·rice avec ce login" msgid "Pas d'utilisateur·rice avec ce login"
msgstr "No user with this username" msgstr "No user with this username"
#: shared/auth/views.py:68
msgid "Compte créé avec succès"
msgstr "Account successfully created"
#: shared/auth/views.py:104 #: shared/auth/views.py:104
msgid "Permissions modifiées avec succès !" msgid "Permissions modifiées avec succès !"
msgstr "Permissions successfully modified!" msgstr "Permissions successfully modified!"
@ -992,6 +997,12 @@ msgstr "Log back in"
msgid "Accueil" msgid "Accueil"
msgstr "Home" msgstr "Home"
#~ msgid "Modification d'une option"
#~ msgstr "Editing an option"
#~ msgid "Modification d'une question"
#~ msgstr "Editing a question"
#~ msgid "Ajouter un rang" #~ msgid "Ajouter un rang"
#~ msgstr "Add an rank" #~ msgstr "Add an rank"