From 663843ef5dd4d2d5b95a08aec444f174fbf0f3aa Mon Sep 17 00:00:00 2001
From: Raz
Mot de passe oublié ?
diff --git a/tournaments/templates/registration/password_reset_complete.html b/tournaments/templates/registration/password_reset_complete.html
index a701c7b..7aac4d0 100644
--- a/tournaments/templates/registration/password_reset_complete.html
+++ b/tournaments/templates/registration/password_reset_complete.html
@@ -11,7 +11,7 @@
Votre mot de passe a été réinitialisé avec succès. Vous pouvez maintenant vous connecter avec votre nouveau mot de passe.
Retour à la connexion
diff --git a/tournaments/templates/registration/password_reset_form.html b/tournaments/templates/registration/password_reset_form.html
index 318f44d..0872462 100644
--- a/tournaments/templates/registration/password_reset_form.html
+++ b/tournaments/templates/registration/password_reset_form.html
@@ -11,7 +11,7 @@
{% csrf_token %}
-
Retour à la connexion
diff --git a/tournaments/templates/registration/signup.html b/tournaments/templates/registration/signup.html
index 7cdcee6..40ca09d 100644
--- a/tournaments/templates/registration/signup.html
+++ b/tournaments/templates/registration/signup.html
@@ -14,7 +14,7 @@
- Se désinscrire + + Se désinscrire +
{% else %}diff --git a/tournaments/views.py b/tournaments/views.py index c64c6fb..eddf5c8 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -619,7 +619,10 @@ def register_tournament(request, tournament_id): validator = LicenseValidator(licence_id) if validator.validate_license() is False and tournament.license_is_required is True: - messages.error(request, f"Le numéro de licence est invalide, la lettre ne correspond pas. {validator.computed_license_key}") + if len(licence_id) == 0: + messages.error(request, f"Le numéro de licence est obligatoire.") + else: + messages.error(request, f"Le numéro de licence est invalide, la lettre ne correspond pas.") return render(request, 'register_tournament.html', { 'team_form': team_form, 'add_player_form': add_player_form, @@ -691,6 +694,20 @@ def register_tournament(request, tournament_id): request.session['is_woman'] = data['is_woman'] request.session.modified = True # Ensure session is updated add_player_form.first_tournament = True + if add_player_form.names_is_valid() is False: + if len(request.session.get('team_registration', [])) == 0: + messages.error(request, "Pour confirmer votre inscription votre prénom et votre nom sont obligatoires.") + else: + messages.error(request, "Pour rajouter un partenaire, son prénom et son nom sont obligatoires.") + return render(request, 'register_tournament.html', { + 'team_form': team_form, + 'add_player_form': add_player_form, + 'tournament': tournament, + 'registration_successful': registration_successful, + 'current_players': request.session['team_registration'], + 'user_without_licence': user_without_licence + }) +