1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-02-25 21:06:30 +00:00

Compare commits

...

8 Commits

Author SHA1 Message Date
Emmy D'Anello
17057a5fe5
Fix tests for the new last_degree field
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-01-20 18:41:17 +01:00
Emmy D'Anello
a738a5a58d
Add last degree field for coaches
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-01-20 18:41:17 +01:00
Emmy D'Anello
b35bebc7c2
Don't use Haystack real time signal processor in dev mode
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-01-20 18:41:06 +01:00
Emmy D'Anello
99f4aed360
Authorization templates are in french
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-01-20 17:10:32 +01:00
Emmy D'Anello
bd2cead945
Authorization templates can be fetched by tournament name
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-01-20 17:09:06 +01:00
Emmy D'Anello
62ab0a4c47
Remove obsolete cas_server config
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-01-18 20:01:59 +01:00
Emmy D'Anello
fd726f4121
Let Haystack realtime signal processor work in all cases
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-01-18 19:58:06 +01:00
Emmy D'Anello
2c02951a0d
Remind that the username is the email address
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-01-18 19:53:12 +01:00
13 changed files with 154 additions and 79 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: TFJM\n" "Project-Id-Version: TFJM\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-16 22:28+0100\n" "POT-Creation-Date: 2024-01-20 18:25+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Emmy D'Anello <emmy.danello@animath.fr>\n" "Last-Translator: Emmy D'Anello <emmy.danello@animath.fr>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -933,8 +933,8 @@ msgstr "Rejoindre"
#: participation/templates/participation/update_team.html:12 #: participation/templates/participation/update_team.html:12
#: registration/templates/registration/payment_form.html:49 #: registration/templates/registration/payment_form.html:49
#: registration/templates/registration/update_user.html:16 #: registration/templates/registration/update_user.html:16
#: registration/templates/registration/user_detail.html:174 #: registration/templates/registration/user_detail.html:180
#: registration/templates/registration/user_detail.html:211 #: registration/templates/registration/user_detail.html:217
msgid "Update" msgid "Update"
msgstr "Modifier" msgstr "Modifier"
@ -1000,11 +1000,11 @@ msgstr "Envoyer une solution"
#: registration/templates/registration/upload_parental_authorization.html:17 #: registration/templates/registration/upload_parental_authorization.html:17
#: registration/templates/registration/upload_photo_authorization.html:18 #: registration/templates/registration/upload_photo_authorization.html:18
#: registration/templates/registration/upload_vaccine_sheet.html:13 #: registration/templates/registration/upload_vaccine_sheet.html:13
#: registration/templates/registration/user_detail.html:184 #: registration/templates/registration/user_detail.html:190
#: registration/templates/registration/user_detail.html:189 #: registration/templates/registration/user_detail.html:195
#: registration/templates/registration/user_detail.html:194 #: registration/templates/registration/user_detail.html:200
#: registration/templates/registration/user_detail.html:199 #: registration/templates/registration/user_detail.html:205
#: registration/templates/registration/user_detail.html:204 #: registration/templates/registration/user_detail.html:210
msgid "Upload" msgid "Upload"
msgstr "Téléverser" msgstr "Téléverser"
@ -1635,7 +1635,7 @@ msgstr "rôle"
msgid "participant" msgid "participant"
msgstr "participant⋅e" msgstr "participant⋅e"
#: registration/forms.py:25 registration/models.py:290 #: registration/forms.py:25 registration/models.py:298
msgid "coach" msgid "coach"
msgstr "encadrant⋅e" msgstr "encadrant⋅e"
@ -1660,7 +1660,7 @@ msgstr "email confirmé"
msgid "Activate your TFJM² account" msgid "Activate your TFJM² account"
msgstr "Activez votre compte du TFJM²" msgstr "Activez votre compte du TFJM²"
#: registration/models.py:95 registration/models.py:343 #: registration/models.py:95 registration/models.py:351
msgid "registration" msgid "registration"
msgstr "inscription" msgstr "inscription"
@ -1801,23 +1801,35 @@ msgstr "inscription d'élève"
msgid "student registrations" msgid "student registrations"
msgstr "inscriptions d'élève" msgstr "inscriptions d'élève"
#: registration/models.py:285 registration/models.py:307 #: registration/models.py:287
msgid "most recent degree in mathematics, computer science or physics"
msgstr "Dernier diplôme obtenu en mathématiques, informatique ou physique"
#: registration/models.py:288
msgid ""
"Your most recent degree in maths, computer science or physics, or your last "
"entrance exam (CAPES, Agrégation,…)"
msgstr ""
"Votre dernier diplôme en mathématiques, informatique ou physique, ou votre "
"dernier concours obtenu (CAPES, Agrégation, …)"
#: registration/models.py:293 registration/models.py:315
msgid "professional activity" msgid "professional activity"
msgstr "activité professionnelle" msgstr "activité professionnelle"
#: registration/models.py:298 #: registration/models.py:306
msgid "coach registration" msgid "coach registration"
msgstr "inscription d'encadrant⋅e" msgstr "inscription d'encadrant⋅e"
#: registration/models.py:299 #: registration/models.py:307
msgid "coach registrations" msgid "coach registrations"
msgstr "inscriptions d'encadrant⋅es" msgstr "inscriptions d'encadrant⋅es"
#: registration/models.py:311 #: registration/models.py:319
msgid "administrator" msgid "administrator"
msgstr "administrateur⋅rice" msgstr "administrateur⋅rice"
#: registration/models.py:312 #: registration/models.py:320
msgid "" msgid ""
"An administrator has all rights. Please don't give this right to all juries " "An administrator has all rights. Please don't give this right to all juries "
"and volunteers." "and volunteers."
@ -1825,76 +1837,76 @@ msgstr ""
"Un⋅e administrateur⋅rice a tous les droits. Merci de ne pas donner ce droit " "Un⋅e administrateur⋅rice a tous les droits. Merci de ne pas donner ce droit "
"à toustes les juré⋅es et bénévoles." "à toustes les juré⋅es et bénévoles."
#: registration/models.py:322 #: registration/models.py:330
msgid "admin" msgid "admin"
msgstr "admin" msgstr "admin"
#: registration/models.py:322 #: registration/models.py:330
msgid "volunteer" msgid "volunteer"
msgstr "bénévole" msgstr "bénévole"
#: registration/models.py:330 #: registration/models.py:338
msgid "volunteer registration" msgid "volunteer registration"
msgstr "inscription de bénévole" msgstr "inscription de bénévole"
#: registration/models.py:331 #: registration/models.py:339
msgid "volunteer registrations" msgid "volunteer registrations"
msgstr "inscriptions de bénévoles" msgstr "inscriptions de bénévoles"
#: registration/models.py:347 #: registration/models.py:355
msgid "type" msgid "type"
msgstr "type" msgstr "type"
#: registration/models.py:350 #: registration/models.py:358
msgid "No payment" msgid "No payment"
msgstr "Pas de paiement" msgstr "Pas de paiement"
#: registration/models.py:352 #: registration/models.py:360
msgid "Scholarship" msgid "Scholarship"
msgstr "Notification de bourse" msgstr "Notification de bourse"
#: registration/models.py:353 #: registration/models.py:361
msgid "Bank transfer" msgid "Bank transfer"
msgstr "Virement bancaire" msgstr "Virement bancaire"
#: registration/models.py:354 #: registration/models.py:362
msgid "Other (please indicate)" msgid "Other (please indicate)"
msgstr "Autre (veuillez spécifier)" msgstr "Autre (veuillez spécifier)"
#: registration/models.py:355 #: registration/models.py:363
msgid "The tournament is free" msgid "The tournament is free"
msgstr "Le tournoi est gratuit" msgstr "Le tournoi est gratuit"
#: registration/models.py:362 #: registration/models.py:370
msgid "scholarship file" msgid "scholarship file"
msgstr "Notification de bourse" msgstr "Notification de bourse"
#: registration/models.py:363 #: registration/models.py:371
msgid "only if you have a scholarship." msgid "only if you have a scholarship."
msgstr "Nécessaire seulement si vous déclarez être boursier." msgstr "Nécessaire seulement si vous déclarez être boursier."
#: registration/models.py:370 #: registration/models.py:378
msgid "additional information" msgid "additional information"
msgstr "informations additionnelles" msgstr "informations additionnelles"
#: registration/models.py:371 #: registration/models.py:379
msgid "To help us to find your payment." msgid "To help us to find your payment."
msgstr "Pour nous aider à retrouver votre paiement, si nécessaire." msgstr "Pour nous aider à retrouver votre paiement, si nécessaire."
#: registration/models.py:377 #: registration/models.py:385
msgid "payment valid" msgid "payment valid"
msgstr "paiement valide" msgstr "paiement valide"
#: registration/models.py:386 #: registration/models.py:394
#, python-brace-format #, python-brace-format
msgid "Payment of {registration}" msgid "Payment of {registration}"
msgstr "Paiement de {registration}" msgstr "Paiement de {registration}"
#: registration/models.py:389 #: registration/models.py:397
msgid "payment" msgid "payment"
msgstr "paiement" msgstr "paiement"
#: registration/models.py:390 #: registration/models.py:398
msgid "payments" msgid "payments"
msgstr "paiements" msgstr "paiements"
@ -1944,8 +1956,8 @@ msgstr ""
#: registration/templates/registration/mails/add_organizer.html:37 #: registration/templates/registration/mails/add_organizer.html:37
#: registration/templates/registration/mails/add_organizer.txt:17 #: registration/templates/registration/mails/add_organizer.txt:17
#: registration/templates/registration/mails/email_validation_email.html:35 #: registration/templates/registration/mails/email_validation_email.html:39
#: registration/templates/registration/mails/email_validation_email.txt:13 #: registration/templates/registration/mails/email_validation_email.txt:15
msgid "The TFJM² team." msgid "The TFJM² team."
msgstr "L'équipe du TFJM²" msgstr "L'équipe du TFJM²"
@ -1974,6 +1986,11 @@ msgstr ""
#: registration/templates/registration/mails/email_validation_email.html:30 #: registration/templates/registration/mails/email_validation_email.html:30
#: registration/templates/registration/mails/email_validation_email.txt:11 #: registration/templates/registration/mails/email_validation_email.txt:11
msgid "As a reminder, your username is your email address:"
msgstr "Pour rappel, vous nom d'utilisateur⋅rice est votre adresse email :"
#: registration/templates/registration/mails/email_validation_email.html:34
#: registration/templates/registration/mails/email_validation_email.txt:13
msgid "Thanks" msgid "Thanks"
msgstr "Merci" msgstr "Merci"
@ -2003,7 +2020,7 @@ msgstr "Votre mot de passe a été changé. Vous pouvez désormais vous connecte
#: tfjm/templates/base.html:136 tfjm/templates/base.html:262 #: tfjm/templates/base.html:136 tfjm/templates/base.html:262
#: tfjm/templates/base.html:263 tfjm/templates/registration/login.html:7 #: tfjm/templates/base.html:263 tfjm/templates/registration/login.html:7
#: tfjm/templates/registration/login.html:8 #: tfjm/templates/registration/login.html:8
#: tfjm/templates/registration/login.html:25 #: tfjm/templates/registration/login.html:30
msgid "Log in" msgid "Log in"
msgstr "Connexion" msgstr "Connexion"
@ -2222,60 +2239,65 @@ msgid "Responsible email address:"
msgstr "Adresse e-mail de læ responsable légal⋅e :" msgstr "Adresse e-mail de læ responsable légal⋅e :"
#: registration/templates/registration/user_detail.html:127 #: registration/templates/registration/user_detail.html:127
msgid "Profesional activity:" msgid "Most recent degree:"
msgstr "Dernier diplôme obtenu :"
#: registration/templates/registration/user_detail.html:130
#: registration/templates/registration/user_detail.html:134
msgid "Professional activity:"
msgstr "Activité professionnelle :" msgstr "Activité professionnelle :"
#: registration/templates/registration/user_detail.html:131 #: registration/templates/registration/user_detail.html:137
msgid "Admin:" msgid "Admin:"
msgstr "Administrateur⋅rice :" msgstr "Administrateur⋅rice :"
#: registration/templates/registration/user_detail.html:136 #: registration/templates/registration/user_detail.html:142
msgid "Grant Animath to contact me in the future about other actions:" msgid "Grant Animath to contact me in the future about other actions:"
msgstr "Autorise Animath à recontacter à propos d'autres actions :" msgstr "Autorise Animath à recontacter à propos d'autres actions :"
#: registration/templates/registration/user_detail.html:144 #: registration/templates/registration/user_detail.html:150
msgid "Payment information:" msgid "Payment information:"
msgstr "Informations de paiement :" msgstr "Informations de paiement :"
#: registration/templates/registration/user_detail.html:146 #: registration/templates/registration/user_detail.html:152
msgid "yes,no,pending" msgid "yes,no,pending"
msgstr "oui,non,en attente" msgstr "oui,non,en attente"
#: registration/templates/registration/user_detail.html:150 #: registration/templates/registration/user_detail.html:156
#: registration/templates/registration/user_detail.html:153 #: registration/templates/registration/user_detail.html:159
msgid "valid:" msgid "valid:"
msgstr "valide :" msgstr "valide :"
#: registration/templates/registration/user_detail.html:157 #: registration/templates/registration/user_detail.html:163
#: registration/templates/registration/user_detail.html:210 #: registration/templates/registration/user_detail.html:216
msgid "Update payment" msgid "Update payment"
msgstr "Modifier le paiement" msgstr "Modifier le paiement"
#: registration/templates/registration/user_detail.html:163 #: registration/templates/registration/user_detail.html:169
msgid "Download scholarship attestation" msgid "Download scholarship attestation"
msgstr "Télécharger l'attestation de bourse" msgstr "Télécharger l'attestation de bourse"
#: registration/templates/registration/user_detail.html:176 #: registration/templates/registration/user_detail.html:182
msgid "Impersonate" msgid "Impersonate"
msgstr "Impersonifier" msgstr "Impersonifier"
#: registration/templates/registration/user_detail.html:183 #: registration/templates/registration/user_detail.html:189
#: registration/views.py:312 #: registration/views.py:312
msgid "Upload photo authorization" msgid "Upload photo authorization"
msgstr "Téléverser l'autorisation de droit à l'image" msgstr "Téléverser l'autorisation de droit à l'image"
#: registration/templates/registration/user_detail.html:188 #: registration/templates/registration/user_detail.html:194
#: registration/views.py:333 #: registration/views.py:333
msgid "Upload health sheet" msgid "Upload health sheet"
msgstr "Téléverser la fiche sanitaire" msgstr "Téléverser la fiche sanitaire"
#: registration/templates/registration/user_detail.html:193 #: registration/templates/registration/user_detail.html:199
#: registration/views.py:354 #: registration/views.py:354
msgid "Upload vaccine sheet" msgid "Upload vaccine sheet"
msgstr "Téléverser le carnet de vaccination" msgstr "Téléverser le carnet de vaccination"
#: registration/templates/registration/user_detail.html:198 #: registration/templates/registration/user_detail.html:204
#: registration/templates/registration/user_detail.html:203 #: registration/templates/registration/user_detail.html:209
#: registration/views.py:375 #: registration/views.py:375
msgid "Upload parental authorization" msgid "Upload parental authorization"
msgstr "Téléverser l'autorisation parentale" msgstr "Téléverser l'autorisation parentale"
@ -2314,36 +2336,36 @@ msgstr "Détails de l'utilisateur⋅rice {user}"
msgid "Update user {user}" msgid "Update user {user}"
msgstr "Mise à jour de l'utilisateur⋅rice {user}" msgstr "Mise à jour de l'utilisateur⋅rice {user}"
#: registration/views.py:481 #: registration/views.py:487
#, python-brace-format #, python-brace-format
msgid "Photo authorization of {student}.{ext}" msgid "Photo authorization of {student}.{ext}"
msgstr "Autorisation de droit à l'image de {student}.{ext}" msgstr "Autorisation de droit à l'image de {student}.{ext}"
#: registration/views.py:504 #: registration/views.py:510
#, python-brace-format #, python-brace-format
msgid "Health sheet of {student}.{ext}" msgid "Health sheet of {student}.{ext}"
msgstr "Fiche sanitaire de {student}.{ext}" msgstr "Fiche sanitaire de {student}.{ext}"
#: registration/views.py:527 #: registration/views.py:533
#, python-brace-format #, python-brace-format
msgid "Vaccine sheet of {student}.{ext}" msgid "Vaccine sheet of {student}.{ext}"
msgstr "Carnet de vaccination de {student}.{ext}" msgstr "Carnet de vaccination de {student}.{ext}"
#: registration/views.py:550 #: registration/views.py:556
#, python-brace-format #, python-brace-format
msgid "Parental authorization of {student}.{ext}" msgid "Parental authorization of {student}.{ext}"
msgstr "Autorisation parentale de {student}.{ext}" msgstr "Autorisation parentale de {student}.{ext}"
#: registration/views.py:572 #: registration/views.py:578
#, python-brace-format #, python-brace-format
msgid "Scholarship attestation of {user}.{ext}" msgid "Scholarship attestation of {user}.{ext}"
msgstr "Notification de bourse de {user}.{ext}" msgstr "Notification de bourse de {user}.{ext}"
#: tfjm/settings.py:167 #: tfjm/settings.py:164
msgid "English" msgid "English"
msgstr "Anglais" msgstr "Anglais"
#: tfjm/settings.py:168 #: tfjm/settings.py:165
msgid "French" msgid "French"
msgstr "Français" msgstr "Français"
@ -2488,8 +2510,12 @@ msgstr ""
"Vous êtes connecté⋅e en tant que %(user)s, mais n'êtes pas autorisé⋅e à " "Vous êtes connecté⋅e en tant que %(user)s, mais n'êtes pas autorisé⋅e à "
"accéder à cette page. Voulez-vous vous reconnecter avec un autre compte ?" "accéder à cette page. Voulez-vous vous reconnecter avec un autre compte ?"
#: tfjm/templates/registration/login.html:23 #: tfjm/templates/registration/login.html:25
msgid "Forgotten your password or username?" msgid "Your username is your e-mail address."
msgstr "Votre identifiant est votre adresse e-mail."
#: tfjm/templates/registration/login.html:28
msgid "Forgotten your password?"
msgstr "Mot de passe oublié ?" msgstr "Mot de passe oublié ?"
#: tfjm/templates/search/search.html:6 tfjm/templates/search/search.html:10 #: tfjm/templates/search/search.html:6 tfjm/templates/search/search.html:10

View File

@ -206,7 +206,7 @@ class CoachRegistrationForm(forms.ModelForm):
class Meta: class Meta:
model = CoachRegistration model = CoachRegistration
fields = ('team', 'gender', 'address', 'zip_code', 'city', 'phone_number', fields = ('team', 'gender', 'address', 'zip_code', 'city', 'phone_number',
'professional_activity', 'health_issues', 'housing_constraints', 'last_degree', 'professional_activity', 'health_issues', 'housing_constraints',
'give_contact_to_animath', 'email_confirmed',) 'give_contact_to_animath', 'email_confirmed',)

View File

@ -0,0 +1,22 @@
# Generated by Django 5.0.1 on 2024-01-20 17:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("registration", "0009_participantregistration_housing_constraints_and_more"),
]
operations = [
migrations.AddField(
model_name="coachregistration",
name="last_degree",
field=models.CharField(
default="",
help_text="Your most recent degree in maths, computer science or physics, or your last entrance exam (CAPES, Agrégation,…)",
max_length=255,
verbose_name="most recent degree in mathematics, computer science or physics",
),
),
]

View File

@ -281,6 +281,14 @@ class CoachRegistration(ParticipantRegistration):
Specific registration for coaches. Specific registration for coaches.
They have a team and a professional activity. They have a team and a professional activity.
""" """
last_degree = models.CharField(
max_length=255,
default="",
verbose_name=_("most recent degree in mathematics, computer science or physics"),
help_text=_("Your most recent degree in maths, computer science or physics, "
"or your last entrance exam (CAPES, Agrégation,…)"),
)
professional_activity = models.TextField( professional_activity = models.TextField(
verbose_name=_("professional activity"), verbose_name=_("professional activity"),
) )

View File

@ -26,6 +26,10 @@
{% trans "This link is only valid for a couple of days, after that you will need to contact us to validate your email." %} {% trans "This link is only valid for a couple of days, after that you will need to contact us to validate your email." %}
</p> </p>
<p>
{% trans "As a reminder, your username is your email address:" %} {{ user.email }}.
</p>
<p> <p>
{% trans "Thanks" %}, {% trans "Thanks" %},
</p> </p>

View File

@ -8,6 +8,8 @@ https://{{ domain }}{% url 'registration:email_validation' uidb64=uid token=toke
{% trans "This link is only valid for a couple of days, after that you will need to contact us to validate your email." %} {% trans "This link is only valid for a couple of days, after that you will need to contact us to validate your email." %}
{% trans "As a reminder, your username is your email address:" %} {{ user.email }}
{% trans "Thanks" %}, {% trans "Thanks" %},
{% trans "The TFJM² team." %} {% trans "The TFJM² team." %}

View File

@ -123,14 +123,19 @@
{% with user_object.registration.responsible_email as email %} {% with user_object.registration.responsible_email as email %}
<dd class="col-sm-6"><a href="mailto:{{ email }}">{{ email }}</a></dd> <dd class="col-sm-6"><a href="mailto:{{ email }}">{{ email }}</a></dd>
{% endwith %} {% endwith %}
{% elif user_object.registration.coachregistration or user_object.registration.is_volunteer %} {% elif user_object.registration.coachregistration %}
<dt class="col-sm-6 text-end">{% trans "Profesional activity:" %}</dt> <dt class="col-sm-6 text-end">{% trans "Most recent degree:" %}</dt>
<dd class="col-sm-6">{{ user_object.registration.last_degree }}</dd>
<dt class="col-sm-6 text-end">{% trans "Professional activity:" %}</dt>
<dd class="col-sm-6">{{ user_object.registration.professional_activity }}</dd> <dd class="col-sm-6">{{ user_object.registration.professional_activity }}</dd>
{% if user_object.registration.is_volunteer %} {% elif user_object.registration.is_volunteer %}
<dt class="col-sm-6 text-end">{% trans "Admin:" %}</dt> <dt class="col-sm-6 text-end">{% trans "Professional activity:" %}</dt>
<dd class="col-sm-6">{{ user_object.registration.is_admin|yesno }}</dd> <dd class="col-sm-6">{{ user_object.registration.professional_activity }}</dd>
{% endif %}
<dt class="col-sm-6 text-end">{% trans "Admin:" %}</dt>
<dd class="col-sm-6">{{ user_object.registration.is_admin|yesno }}</dd>
{% endif %} {% endif %}
<dt class="col-sm-6 text-end">{% trans "Grant Animath to contact me in the future about other actions:" %}</dt> <dt class="col-sm-6 text-end">{% trans "Grant Animath to contact me in the future about other actions:" %}</dt>

View File

@ -196,6 +196,7 @@ class TestRegistration(TestCase):
city="Paris", city="Paris",
phone_number="0123456789", phone_number="0123456789",
professional_activity="God", professional_activity="God",
last_degree="Master",
give_contact_to_animath=True, give_contact_to_animath=True,
)) ))
self.assertRedirects(response, reverse("registration:email_validation_sent"), 302, 200) self.assertRedirects(response, reverse("registration:email_validation_sent"), 302, 200)
@ -276,7 +277,7 @@ class TestRegistration(TestCase):
city="Paris", responsible_name="Toto", city="Paris", responsible_name="Toto",
responsible_phone="0123456789", responsible_phone="0123456789",
responsible_email="toto@example.com")), responsible_email="toto@example.com")),
(self.coach, dict(professional_activity="God", gender="male", (self.coach, dict(professional_activity="God", last_degree="Médaille Fields", gender="male",
address="1 Rue de Rivoli", zip_code=75001, city="Paris"))]: address="1 Rue de Rivoli", zip_code=75001, city="Paris"))]:
response = self.client.get(reverse("registration:update_user", args=(user.pk,))) response = self.client.get(reverse("registration:update_user", args=(user.pk,)))
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)

View File

@ -16,7 +16,7 @@ from django.http import FileResponse, Http404
from django.shortcuts import redirect, resolve_url from django.shortcuts import redirect, resolve_url
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils import timezone from django.utils import timezone, translation
from django.utils.crypto import get_random_string from django.utils.crypto import get_random_string
from django.utils.http import urlsafe_base64_decode from django.utils.http import urlsafe_base64_decode
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
@ -390,6 +390,8 @@ class AuthorizationTemplateView(TemplateView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
translation.activate("fr")
if "registration_id" in self.request.GET: if "registration_id" in self.request.GET:
registration = Registration.objects.get(pk=self.request.GET.get("registration_id")) registration = Registration.objects.get(pk=self.request.GET.get("registration_id"))
# Don't get unwanted information # Don't get unwanted information
@ -400,6 +402,10 @@ class AuthorizationTemplateView(TemplateView):
if not Tournament.objects.filter(pk=self.request.GET.get("tournament_id")).exists(): if not Tournament.objects.filter(pk=self.request.GET.get("tournament_id")).exists():
raise PermissionDenied("Ce tournoi n'existe pas.") raise PermissionDenied("Ce tournoi n'existe pas.")
context["tournament"] = Tournament.objects.get(pk=self.request.GET.get("tournament_id")) context["tournament"] = Tournament.objects.get(pk=self.request.GET.get("tournament_id"))
elif "tournament_name" in self.request.GET:
if not Tournament.objects.filter(name__iexact=self.request.GET.get("tournament_name")).exists():
raise PermissionDenied("Ce tournoi n'existe pas.")
context["tournament"] = Tournament.objects.get(name__iexact=self.request.GET.get("tournament_name"))
else: else:
raise PermissionDenied("Merci d'indiquer un tournoi.") raise PermissionDenied("Merci d'indiquer un tournoi.")

View File

@ -206,6 +206,9 @@ HAYSTACK_CONNECTIONS = {
} }
} }
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' if os.getenv("HAYSTACK_INDEX_NAME", None) \
else 'haystack.signals.BaseSignalProcessor'
_db_type = os.getenv('DJANGO_DB_TYPE', 'sqlite').lower() _db_type = os.getenv('DJANGO_DB_TYPE', 'sqlite').lower()
if _db_type == 'mysql' or _db_type.startswith('postgres') or _db_type == 'psql': # pragma: no cover if _db_type == 'mysql' or _db_type.startswith('postgres') or _db_type == 'psql': # pragma: no cover

View File

@ -37,5 +37,3 @@ CHANNEL_LAYERS = {
}, },
}, },
} }
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'

View File

@ -18,9 +18,14 @@ SPDX-License-Identifier: GPL-2.0-or-later
{% endif %} {% endif %}
<form method="post" id="login-form"> <form method="post" id="login-form">
<div id="form-content"> <div id="form-content">
{{ form|as_crispy_errors }}
{% csrf_token %} {% csrf_token %}
{{ form | crispy }} {{ form.username|as_crispy_field }}
<a href="{% url 'password_reset' %}" class="badge text-bg-warning">{% trans 'Forgotten your password or username?' %}</a> <div class="form-text mb-3">
<i class="fas fa-info-circle"></i> {% trans "Your username is your e-mail address." %}
</div>
{{ form.password|as_crispy_field }}
<a href="{% url 'password_reset' %}" class="badge text-bg-warning">{% trans 'Forgotten your password?' %}</a>
</div> </div>
<input type="submit" value="{% trans 'Log in' %}" class="btn btn-primary"> <input type="submit" value="{% trans 'Log in' %}" class="btn btn-primary">
</form> </form>

View File

@ -60,11 +60,6 @@ urlpatterns = [
name='synthesis'), name='synthesis'),
] ]
if 'cas_server' in settings.INSTALLED_APPS: # pragma: no cover
urlpatterns += [
path('cas/', include('cas_server.urls', namespace="cas_server")),
]
if settings.DEBUG: if settings.DEBUG:
# Serve static files in DEBUG mode # Serve static files in DEBUG mode
import django.contrib.staticfiles.urls import django.contrib.staticfiles.urls