Compare commits

..

No commits in common. "82aa0182e3fa96606961af53e012e224e1dbff42" and "d7b834d9089e647084944b37ae4e24f3a03e5a72" have entirely different histories.

8 changed files with 77 additions and 92 deletions

View File

@ -131,7 +131,7 @@ class Profile(models.Model):
return reverse('user_detail', args=(self.pk,))
def send_email_validation_link(self):
subject = _("Activate your Note Kfet account")
subject = "Activate your Note Kfet account"
message = loader.render_to_string('registration/mails/email_validation_email.html',
{
'user': self.user,

View File

@ -108,7 +108,6 @@ class UserUpdateView(ProtectQuerysetMixin, LoginRequiredMixin, UpdateView):
if olduser.email != user.email:
# If the user changed her/his email, then it is unvalidated and a confirmation link is sent.
user.profile.email_confirmed = False
user.profile.save()
user.profile.send_email_validation_link()
return super().form_valid(form)

View File

@ -24,8 +24,7 @@ class AccountActivationTokenGenerator(PasswordResetTokenGenerator):
# Truncate microseconds so that tokens are consistent even if the
# database doesn't support microseconds.
login_timestamp = '' if user.last_login is None else user.last_login.replace(microsecond=0, tzinfo=None)
return str(user.pk) + str(user.email) + str(user.profile.email_confirmed)\
+ str(login_timestamp) + str(timestamp)
return str(user.pk) + str(user.profile.email_confirmed) + str(login_timestamp) + str(timestamp)
email_validation_token = AccountActivationTokenGenerator()

View File

@ -79,7 +79,7 @@ class UserValidateView(TemplateView):
"""
title = _("Email validation")
template_name = 'registration/email_validation_complete.html'
extra_context = {"title": _("Validate email")}
extra_context = {"title": _("Validate a registration")}
def get(self, *args, **kwargs):
"""
@ -93,12 +93,15 @@ class UserValidateView(TemplateView):
# Validate the token
if user is not None and email_validation_token.check_token(user, token):
# The user must wait that someone validates the account before the user can be active and login.
self.validlink = True
# The user must wait that someone validates the account before the user can be active and login.
user.is_active = user.profile.registration_valid or user.is_superuser
user.profile.email_confirmed = True
user.save()
user.profile.save()
return super().dispatch(*args, **kwargs)
else:
# Display the "Email validation unsuccessful" page.
return self.render_to_response(self.get_context_data())
def get_user(self, uidb64):

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-01 10:47+0200\n"
"POT-Creation-Date: 2020-07-31 22:25+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -456,10 +456,6 @@ msgstr ""
msgid "user profile"
msgstr ""
#: apps/member/models.py:134
msgid "Activate your Note Kfet account"
msgstr ""
#: apps/member/models.py:156 templates/member/club_info.html:57
#: templates/registration/future_profile_detail.html:22
#: templates/wei/weiclub_info.html:52 templates/wei/weimembership_form.html:24
@ -537,7 +533,7 @@ msgstr ""
msgid "fee"
msgstr ""
#: apps/member/models.py:303 apps/member/views.py:535 apps/wei/views.py:797
#: apps/member/models.py:303 apps/member/views.py:534 apps/wei/views.py:797
msgid "User is not a member of the parent club"
msgstr ""
@ -546,7 +542,7 @@ msgstr ""
msgid "The role {role} does not apply to the club {club}."
msgstr ""
#: apps/member/models.py:321 apps/member/views.py:544
#: apps/member/models.py:321 apps/member/views.py:543
msgid "User is already a member of the club"
msgstr ""
@ -577,71 +573,71 @@ msgstr ""
msgid "This address must be valid."
msgstr ""
#: apps/member/views.py:128
#: apps/member/views.py:127
msgid "Profile detail"
msgstr ""
#: apps/member/views.py:162
#: apps/member/views.py:161
msgid "Search user"
msgstr ""
#: apps/member/views.py:196 apps/member/views.py:382
#: apps/member/views.py:195 apps/member/views.py:381
msgid "Note aliases"
msgstr ""
#: apps/member/views.py:210
#: apps/member/views.py:209
msgid "Update note picture"
msgstr ""
#: apps/member/views.py:268 templates/member/profile_info.html:43
#: apps/member/views.py:267 templates/member/profile_info.html:43
msgid "Manage auth token"
msgstr ""
#: apps/member/views.py:296
#: apps/member/views.py:295
msgid "Create new club"
msgstr ""
#: apps/member/views.py:308
#: apps/member/views.py:307
msgid "Search club"
msgstr ""
#: apps/member/views.py:333
#: apps/member/views.py:332
msgid "Club detail"
msgstr ""
#: apps/member/views.py:399
#: apps/member/views.py:398
msgid "Update club"
msgstr ""
#: apps/member/views.py:433
#: apps/member/views.py:432
msgid "Add new member to the club"
msgstr ""
#: apps/member/views.py:530 apps/wei/views.py:788
#: apps/member/views.py:529 apps/wei/views.py:788
msgid ""
"This user don't have enough money to join this club, and can't have a "
"negative balance."
msgstr ""
#: apps/member/views.py:548
#: apps/member/views.py:547
msgid "The membership must start after {:%m-%d-%Y}."
msgstr ""
#: apps/member/views.py:553
#: apps/member/views.py:552
msgid "The membership must begin before {:%m-%d-%Y}."
msgstr ""
#: apps/member/views.py:570 apps/member/views.py:572 apps/member/views.py:574
#: apps/registration/views.py:292 apps/registration/views.py:294
#: apps/registration/views.py:296
#: apps/member/views.py:569 apps/member/views.py:571 apps/member/views.py:573
#: apps/registration/views.py:295 apps/registration/views.py:297
#: apps/registration/views.py:299
msgid "This field is required."
msgstr ""
#: apps/member/views.py:642
#: apps/member/views.py:641
msgid "Manage roles of an user in the club"
msgstr ""
#: apps/member/views.py:667
#: apps/member/views.py:666
msgid "Members of the club"
msgstr ""
@ -1055,47 +1051,47 @@ msgid "Email validation"
msgstr ""
#: apps/registration/views.py:82
msgid "Validate email"
msgid "Validate a registration"
msgstr ""
#: apps/registration/views.py:124
#: apps/registration/views.py:127
msgid "Email validation unsuccessful"
msgstr ""
#: apps/registration/views.py:135
#: apps/registration/views.py:138
msgid "Email validation email sent"
msgstr ""
#: apps/registration/views.py:143
#: apps/registration/views.py:146
msgid "Resend email validation link"
msgstr ""
#: apps/registration/views.py:161
#: apps/registration/views.py:164
msgid "Pre-registered users list"
msgstr ""
#: apps/registration/views.py:190
#: apps/registration/views.py:193
msgid "Unregistered users"
msgstr ""
#: apps/registration/views.py:203
#: apps/registration/views.py:206
msgid "Registration detail"
msgstr ""
#: apps/registration/views.py:258
#: apps/registration/views.py:261
msgid "You must join the BDE."
msgstr ""
#: apps/registration/views.py:280
#: apps/registration/views.py:283
msgid "You must join BDE club before joining Kfet club."
msgstr ""
#: apps/registration/views.py:285
#: apps/registration/views.py:288
msgid ""
"The entered amount is not enough for the memberships, should be at least {}"
msgstr ""
#: apps/registration/views.py:360
#: apps/registration/views.py:363
msgid "Invalidate pre-registration"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-01 10:47+0200\n"
"POT-Creation-Date: 2020-07-31 22:25+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -457,10 +457,6 @@ msgstr "inscription valid"
msgid "user profile"
msgstr "profil utilisateur"
#: apps/member/models.py:134
msgid "Activate your Note Kfet account"
msgstr "Activez votre compte Note Kfet"
#: apps/member/models.py:156 templates/member/club_info.html:57
#: templates/registration/future_profile_detail.html:22
#: templates/wei/weiclub_info.html:52 templates/wei/weimembership_form.html:24
@ -542,7 +538,7 @@ msgstr "l'adhésion finit le"
msgid "fee"
msgstr "cotisation"
#: apps/member/models.py:303 apps/member/views.py:535 apps/wei/views.py:797
#: apps/member/models.py:303 apps/member/views.py:534 apps/wei/views.py:797
msgid "User is not a member of the parent club"
msgstr "L'utilisateur n'est pas membre du club parent"
@ -551,7 +547,7 @@ msgstr "L'utilisateur n'est pas membre du club parent"
msgid "The role {role} does not apply to the club {club}."
msgstr "Le rôle {role} ne s'applique pas au club {club}."
#: apps/member/models.py:321 apps/member/views.py:544
#: apps/member/models.py:321 apps/member/views.py:543
msgid "User is already a member of the club"
msgstr "L'utilisateur est déjà membre du club"
@ -582,47 +578,47 @@ msgstr "Modifier le profil"
msgid "This address must be valid."
msgstr "Cette adresse doit être valide."
#: apps/member/views.py:128
#: apps/member/views.py:127
msgid "Profile detail"
msgstr "Détails de l'utilisateur"
#: apps/member/views.py:162
#: apps/member/views.py:161
msgid "Search user"
msgstr "Chercher un utilisateur"
#: apps/member/views.py:196 apps/member/views.py:382
#: apps/member/views.py:195 apps/member/views.py:381
msgid "Note aliases"
msgstr "Alias de la note"
#: apps/member/views.py:210
#: apps/member/views.py:209
msgid "Update note picture"
msgstr "Modifier la photo de la note"
#: apps/member/views.py:268 templates/member/profile_info.html:43
#: apps/member/views.py:267 templates/member/profile_info.html:43
msgid "Manage auth token"
msgstr "Gérer les jetons d'authentification"
#: apps/member/views.py:296
#: apps/member/views.py:295
msgid "Create new club"
msgstr "Créer un nouveau club"
#: apps/member/views.py:308
#: apps/member/views.py:307
msgid "Search club"
msgstr "Chercher un club"
#: apps/member/views.py:333
#: apps/member/views.py:332
msgid "Club detail"
msgstr "Détails du club"
#: apps/member/views.py:399
#: apps/member/views.py:398
msgid "Update club"
msgstr "Modifier le club"
#: apps/member/views.py:433
#: apps/member/views.py:432
msgid "Add new member to the club"
msgstr "Ajouter un nouveau membre au club"
#: apps/member/views.py:530 apps/wei/views.py:788
#: apps/member/views.py:529 apps/wei/views.py:788
msgid ""
"This user don't have enough money to join this club, and can't have a "
"negative balance."
@ -630,25 +626,25 @@ msgstr ""
"Cet utilisateur n'a pas assez d'argent pour rejoindre ce club et ne peut pas "
"avoir un solde négatif."
#: apps/member/views.py:548
#: apps/member/views.py:547
msgid "The membership must start after {:%m-%d-%Y}."
msgstr "L'adhésion doit commencer après le {:%d/%m/%Y}."
#: apps/member/views.py:553
#: apps/member/views.py:552
msgid "The membership must begin before {:%m-%d-%Y}."
msgstr "L'adhésion doit commencer avant le {:%d/%m/%Y}."
#: apps/member/views.py:570 apps/member/views.py:572 apps/member/views.py:574
#: apps/registration/views.py:292 apps/registration/views.py:294
#: apps/registration/views.py:296
#: apps/member/views.py:569 apps/member/views.py:571 apps/member/views.py:573
#: apps/registration/views.py:295 apps/registration/views.py:297
#: apps/registration/views.py:299
msgid "This field is required."
msgstr "Ce champ est requis."
#: apps/member/views.py:642
#: apps/member/views.py:641
msgid "Manage roles of an user in the club"
msgstr "Gérer les rôles d'un utilisateur dans le club"
#: apps/member/views.py:667
#: apps/member/views.py:666
msgid "Members of the club"
msgstr "Membres du club"
@ -1080,49 +1076,49 @@ msgid "Email validation"
msgstr "Validation de l'adresse mail"
#: apps/registration/views.py:82
msgid "Validate email"
msgstr "Valider l'adresse e-mail"
msgid "Validate a registration"
msgstr "Valider l'inscription"
#: apps/registration/views.py:124
#: apps/registration/views.py:127
msgid "Email validation unsuccessful"
msgstr " La validation de l'adresse mail a échoué"
#: apps/registration/views.py:135
#: apps/registration/views.py:138
msgid "Email validation email sent"
msgstr "L'email de vérification de l'adresse email a bien été envoyé."
#: apps/registration/views.py:143
#: apps/registration/views.py:146
msgid "Resend email validation link"
msgstr "Renvoyer le lien de validation"
#: apps/registration/views.py:161
#: apps/registration/views.py:164
msgid "Pre-registered users list"
msgstr "Liste des utilisateurs en attente d'inscription"
#: apps/registration/views.py:190
#: apps/registration/views.py:193
msgid "Unregistered users"
msgstr "Utilisateurs en attente d'inscription"
#: apps/registration/views.py:203
#: apps/registration/views.py:206
msgid "Registration detail"
msgstr "Détails de l'inscription"
#: apps/registration/views.py:258
#: apps/registration/views.py:261
msgid "You must join the BDE."
msgstr "Vous devez adhérer au BDE."
#: apps/registration/views.py:280
#: apps/registration/views.py:283
msgid "You must join BDE club before joining Kfet club."
msgstr "Vous devez adhérer au club BDE avant d'adhérer au club Kfet."
#: apps/registration/views.py:285
#: apps/registration/views.py:288
msgid ""
"The entered amount is not enough for the memberships, should be at least {}"
msgstr ""
"Le montant crédité est trop faible pour adhérer, il doit être au minimum de "
"{}"
#: apps/registration/views.py:360
#: apps/registration/views.py:363
msgid "Invalidate pre-registration"
msgstr "Invalider l'inscription"
@ -2664,6 +2660,3 @@ msgstr "Il n'y a pas de pré-inscription en attente avec cette entrée."
#: templates/wei/weiregistration_list.html:24
msgid "View validated memberships..."
msgstr "Voir les adhésions validées ..."
#~ msgid "Validate a registration"
#~ msgstr "Valider l'inscription"

View File

@ -80,7 +80,6 @@ $(document).ready(function() {
let dest = $("#dest_note");
$("#type_transfer").click(function() {
$("#source_me_div").removeClass('d-none');
$("#special_transaction_div").addClass('d-none');
source.attr('disabled', false);
$("#source_note_list").removeClass('d-none');
@ -89,7 +88,6 @@ $(document).ready(function() {
});
$("#type_credit").click(function() {
$("#source_me_div").addClass('d-none');
$("#special_transaction_div").removeClass('d-none');
$("#source_note_list").addClass('d-none');
$("#dest_note_list").removeClass('d-none');
@ -107,7 +105,6 @@ $(document).ready(function() {
});
$("#type_debit").click(function() {
$("#source_me_div").addClass('d-none');
$("#special_transaction_div").removeClass('d-none');
$("#source_note_list").removeClass('d-none');
$("#dest_note_list").addClass('d-none');

View File

@ -55,7 +55,6 @@ SPDX-License-Identifier: GPL-2.0-or-later
</ul>
<div class="card-body">
<input class="form-control mx-auto d-block" type="text" id="source_note" placeholder="{% trans "Name or alias..." %}" />
<div id="source_me_div">
<hr>
<span class="form-control mx-auto d-block btn btn-secondary" id="source_me">
{% trans "I am the emitter" %}
@ -63,7 +62,6 @@ SPDX-License-Identifier: GPL-2.0-or-later
</div>
</div>
</div>
</div>
<div class="col-md-3" id="dests_div">
<div class="card border-info shadow mb-4">