1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-02-23 07:01:19 +00:00

Compare commits

..

No commits in common. "73cadd8cfd2d88e6807e098e2b8123e11499f569" and "12acb0ca26d007b44ff97bee2eeff3b9353e13dd" have entirely different histories.

7 changed files with 88 additions and 119 deletions

View File

@ -17,22 +17,11 @@ class TeamForm(forms.ModelForm):
"""
Form to create a team, with the name and the trigram,...
"""
def clean_name(self):
if "name" in self.cleaned_data:
name = self.cleaned_data["name"].upper()
if not self.instance.pk and Team.objects.filter(name=name).exists():
raise ValidationError(_("This name is already used."))
return name
def clean_trigram(self):
if "trigram" in self.cleaned_data:
trigram = self.cleaned_data["trigram"].upper()
if not re.match("[A-Z]{3}", trigram):
raise ValidationError(_("The trigram must be composed of three uppercase letters."))
if not self.instance.pk and Team.objects.filter(trigram=trigram).exists():
raise ValidationError(_("This trigram is already used."))
return trigram
trigram = self.cleaned_data["trigram"].upper()
if not re.match("[A-Z]{3}", trigram):
raise ValidationError(_("The trigram must be composed of three uppercase letters."))
return trigram
class Meta:
model = Team

View File

@ -56,11 +56,10 @@ class Command(BaseCommand):
for team in Team.objects.filter(Q(participation__valid=False) | Q(participation__valid__isnull=True)).all():
team.create_mailing_list()
sympa.subscribe(team.email, "equipes-non-valides", True, f"Equipe {team.name}")
sympa.subscribe(team.email, "equipes-non-valides", f"Equipe {team.name}", True)
for participant in ParticipantRegistration.objects.filter(team__isnull=False).all():
sympa.subscribe(participant.user.email, f"equipe-{participant.team.trigram.lower()}",
True, f"{participant}")
sympa.subscribe(participant.user.email, f"equipe-{participant.team.trigram.lower}", True, f"{participant}")
for volunteer in VolunteerRegistration.objects.all():
for organized_tournament in volunteer.organized_tournaments.all():

View File

@ -225,7 +225,7 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
mail_context = dict(team=self.object, domain=Site.objects.first().domain)
mail_plain = render_to_string("participation/mails/request_validation.txt", mail_context)
mail_html = render_to_string("participation/mails/request_validation.html", mail_context)
send_mail("[TFJM²] Validation d'équipe", mail_plain, settings.DEFAULT_FROM_EMAIL,
send_mail("[TFJM²] Validation d'équipe", mail_plain, [settings.DEFAULT_FROM_EMAIL],
[self.object.participation.tournament.organizers_email], html_message=mail_html)
return super().form_valid(form)
@ -234,9 +234,8 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
"""
An admin validates the team (or not)
"""
if not self.request.user.registration.is_admin and \
(not self.object.participation.tournament
or self.request.user.registration not in self.object.participation.tournament.organizers.all()):
if not self.object.participation.tournament \
or self.request.user.registration not in self.object.participation.tournament.organizers.all():
form.add_error(None, _("You are not an organizer of the tournament."))
return self.form_invalid(form)
elif self.object.participation.valid is not False:

View File

@ -3,7 +3,7 @@
{% load django_tables2 i18n %}
{% block content %}
{% if user.registration.is_volunteer %}
{% if user.registration.is_admin %}
<a href="{% url "registration:add_organizer" %}" class="btn btn-block btn-secondary">
<i class="fas fa-user-plus"></i> {% trans "Add organizer" %}
</a>

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: TFJM\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-07 17:38+0100\n"
"POT-Creation-Date: 2021-01-23 21:55+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Yohann D'ANELLO <yohann.danello@animath.fr>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -104,59 +104,51 @@ msgstr "Changelog de type \"{action}\" pour le modèle {model} le {timestamp}"
msgid "valid"
msgstr "valide"
#: apps/participation/forms.py:24
msgid "This name is already used."
msgstr "Ce nom est déjà utilisé."
#: apps/participation/forms.py:31 apps/participation/models.py:41
#: apps/participation/forms.py:23 apps/participation/models.py:41
msgid "The trigram must be composed of three uppercase letters."
msgstr "Le trigramme doit être composé de trois lettres majuscules."
#: apps/participation/forms.py:34
msgid "This trigram is already used."
msgstr "Ce trigramme est déjà utilisé."
#: apps/participation/forms.py:49
#: apps/participation/forms.py:38
msgid "No team was found with this access code."
msgstr "Aucune équipe n'a été trouvée avec ce code d'accès."
#: apps/participation/forms.py:78 apps/participation/forms.py:213
#: apps/registration/forms.py:117 apps/registration/forms.py:139
#: apps/registration/forms.py:161 apps/registration/forms.py:215
#: apps/participation/forms.py:67 apps/participation/forms.py:202
#: apps/registration/forms.py:116 apps/registration/forms.py:138
#: apps/registration/forms.py:160 apps/registration/forms.py:214
msgid "The uploaded file size must be under 2 Mo."
msgstr "Le fichier envoyé doit peser moins de 2 Mo."
#: apps/participation/forms.py:80 apps/registration/forms.py:119
#: apps/registration/forms.py:141 apps/registration/forms.py:163
#: apps/registration/forms.py:217
#: apps/participation/forms.py:69 apps/registration/forms.py:118
#: apps/registration/forms.py:140 apps/registration/forms.py:162
#: apps/registration/forms.py:216
msgid "The uploaded file must be a PDF, PNG of JPEG file."
msgstr "Le fichier envoyé doit être au format PDF, PNG ou JPEG."
#: apps/participation/forms.py:98
#: apps/participation/forms.py:87
msgid "I engage myself to participate to the whole TFJM²."
msgstr "Je m'engage à participer à l'intégralité du TFJM²."
#: apps/participation/forms.py:113
#: apps/participation/forms.py:102
msgid "Message to address to the team:"
msgstr "Message à adresser à l'équipe :"
#: apps/participation/forms.py:150
#: apps/participation/forms.py:139
msgid "The uploaded file size must be under 5 Mo."
msgstr "Le fichier envoyé doit peser moins de 5 Mo."
#: apps/participation/forms.py:152 apps/participation/forms.py:215
#: apps/participation/forms.py:141 apps/participation/forms.py:204
msgid "The uploaded file must be a PDF file."
msgstr "Le fichier envoyé doit être au format PDF."
#: apps/participation/forms.py:156
#: apps/participation/forms.py:145
msgid "The PDF file must not have more than 30 pages."
msgstr "Le fichier PDF ne doit pas avoir plus de 30 pages."
#: apps/participation/forms.py:196
#: apps/participation/forms.py:185
msgid "The defender, the opponent and the reporter must be different."
msgstr "Le défenseur, l'opposant et le rapporteur doivent être différents."
#: apps/participation/forms.py:200
#: apps/participation/forms.py:189
msgid "This defender did not work on this problem."
msgstr "Ce défenseur ne travaille pas sur ce problème."
@ -514,12 +506,12 @@ msgstr ""
#: apps/participation/templates/participation/create_team.html:11
#: apps/participation/templates/participation/tournament_form.html:14
#: tfjm/templates/base.html:234
#: tfjm/templates/base.html:240
msgid "Create"
msgstr "Créer"
#: apps/participation/templates/participation/join_team.html:11
#: tfjm/templates/base.html:229
#: tfjm/templates/base.html:235
msgid "Join"
msgstr "Rejoindre"
@ -537,7 +529,8 @@ msgstr "Rejoindre"
#: apps/registration/templates/registration/payment_form.html:49
#: apps/registration/templates/registration/update_user.html:16
#: apps/registration/templates/registration/user_detail.html:153
#: apps/registration/templates/registration/user_detail.html:185
#: apps/registration/templates/registration/user_detail.html:162
#: apps/registration/templates/registration/user_detail.html:190
msgid "Update"
msgstr "Modifier"
@ -593,10 +586,10 @@ msgstr "Envoyer une solution"
#: apps/registration/templates/registration/upload_health_sheet.html:17
#: apps/registration/templates/registration/upload_parental_authorization.html:17
#: apps/registration/templates/registration/upload_photo_authorization.html:18
#: apps/registration/templates/registration/user_detail.html:163
#: apps/registration/templates/registration/user_detail.html:168
#: apps/registration/templates/registration/user_detail.html:173
#: apps/registration/templates/registration/user_detail.html:178
#: apps/registration/templates/registration/user_detail.html:183
msgid "Upload"
msgstr "Téléverser"
@ -831,8 +824,8 @@ msgid ""
"Your team must be composed of 4 members and a coach and each member must "
"upload their authorizations and confirm its email address."
msgstr ""
"Votre équipe doit être composée d'au moins 4 membres et un encadrant et "
"chaque membre doit envoyer ses autorisations et confirmé son adresse e-mail."
"Votre équipe doit être composée d'au moins 4 membres et un encadrant et chaque "
"membre doit envoyer ses autorisations et confirmé son adresse e-mail."
#: apps/participation/templates/participation/team_detail.html:146
msgid "This team didn't ask for validation yet."
@ -859,7 +852,7 @@ msgid "Invalidate"
msgstr "Invalider"
#: apps/participation/templates/participation/team_detail.html:169
#: apps/participation/views.py:324
#: apps/participation/views.py:323
msgid "Upload motivation letter"
msgstr "Envoyer la lettre de motivation"
@ -868,7 +861,7 @@ msgid "Update team"
msgstr "Modifier l'équipe"
#: apps/participation/templates/participation/team_detail.html:179
#: apps/participation/views.py:425
#: apps/participation/views.py:424
msgid "Leave team"
msgstr "Quitter l'équipe"
@ -877,7 +870,7 @@ msgid "Are you sure that you want to leave this team?"
msgstr "Êtes-vous sûr·e de vouloir quitter cette équipe ?"
#: apps/participation/templates/participation/team_list.html:6
#: tfjm/templates/base.html:222
#: tfjm/templates/base.html:228
msgid "All teams"
msgstr "Toutes les équipes"
@ -960,7 +953,7 @@ msgid "Add pool"
msgstr "Ajouter une poule"
#: apps/participation/templates/participation/tournament_list.html:6
#: tfjm/templates/base.html:218
#: tfjm/templates/base.html:224
msgid "All tournaments"
msgstr "Tous les tournois"
@ -973,7 +966,7 @@ msgid "Back to the team detail"
msgstr "Retour aux détails de l'utilisateur"
#: apps/participation/views.py:43 tfjm/templates/base.html:74
#: tfjm/templates/base.html:233
#: tfjm/templates/base.html:239
msgid "Create team"
msgstr "Créer une équipe"
@ -986,16 +979,16 @@ msgid "You are already in a team."
msgstr "Vous êtes déjà dans une équipe."
#: apps/participation/views.py:88 tfjm/templates/base.html:79
#: tfjm/templates/base.html:228
#: tfjm/templates/base.html:234
msgid "Join team"
msgstr "Rejoindre une équipe"
#: apps/participation/views.py:150 apps/participation/views.py:431
#: apps/participation/views.py:464
#: apps/participation/views.py:150 apps/participation/views.py:430
#: apps/participation/views.py:463
msgid "You are not in a team."
msgstr "Vous n'êtes pas dans une équipe."
#: apps/participation/views.py:151 apps/participation/views.py:465
#: apps/participation/views.py:151 apps/participation/views.py:464
msgid "You don't participate, so you don't have any team."
msgstr "Vous ne participez pas, vous n'avez donc pas d'équipe."
@ -1023,98 +1016,98 @@ msgstr ""
"d'adresse e-mail, soit une autorisation, soit des personnes, soit la lettre "
"de motivation, soit le tournoi n'a pas été choisi."
#: apps/participation/views.py:240
#: apps/participation/views.py:239
msgid "You are not an organizer of the tournament."
msgstr "Vous n'êtes pas un organisateur du tournoi."
#: apps/participation/views.py:243
#: apps/participation/views.py:242
msgid "This team has no pending validation."
msgstr "L'équipe n'a pas de validation en attente."
#: apps/participation/views.py:273
#: apps/participation/views.py:272
msgid "You must specify if you validate the registration or not."
msgstr "Vous devez spécifier si vous validez l'inscription ou non."
#: apps/participation/views.py:304
#: apps/participation/views.py:303
#, python-brace-format
msgid "Update team {trigram}"
msgstr "Mise à jour de l'équipe {trigram}"
#: apps/participation/views.py:362 apps/participation/views.py:411
#: apps/participation/views.py:361 apps/participation/views.py:410
#, python-brace-format
msgid "Motivation letter of {team}.{ext}"
msgstr "Lettre de motivation de {team}.{ext}"
#: apps/participation/views.py:392
#: apps/participation/views.py:391
#, python-brace-format
msgid "Photo authorization of {participant}.{ext}"
msgstr "Autorisation de droit à l'image de {participant}.{ext}"
#: apps/participation/views.py:398
#: apps/participation/views.py:397
#, python-brace-format
msgid "Parental authorization of {participant}.{ext}"
msgstr "Autorisation parentale de {participant}.{ext}"
#: apps/participation/views.py:405
#: apps/participation/views.py:404
#, python-brace-format
msgid "Health sheet of {participant}.{ext}"
msgstr "Fiche sanitaire de {participant}.{ext}"
#: apps/participation/views.py:415
#: apps/participation/views.py:414
#, python-brace-format
msgid "Photo authorizations of team {trigram}.zip"
msgstr "Autorisations de droit à l'image de l'équipe {trigram}.zip"
#: apps/participation/views.py:433
#: apps/participation/views.py:432
msgid "The team is already validated or the validation is pending."
msgstr "La validation de l'équipe est déjà faite ou en cours."
#: apps/participation/views.py:479
#: apps/participation/views.py:478
msgid "The team is not validated yet."
msgstr "L'équipe n'est pas encore validée."
#: apps/participation/views.py:491
#: apps/participation/views.py:490
#, python-brace-format
msgid "Participation of team {trigram}"
msgstr "Participation de l'équipe {trigram}"
#: apps/participation/views.py:580
#: apps/participation/views.py:579
msgid "You can't upload a solution after the deadline."
msgstr "Vous ne pouvez pas envoyer de solution après la date limite."
#: apps/participation/views.py:761
#: apps/participation/views.py:760
msgid "You can't upload a synthesis after the deadline."
msgstr "Vous ne pouvez pas envoyer de note de synthèse après la date limite."
#: apps/registration/forms.py:22 apps/registration/forms.py:54
#: apps/registration/forms.py:21 apps/registration/forms.py:53
msgid "role"
msgstr "rôle"
#: apps/registration/forms.py:24
#: apps/registration/forms.py:23
msgid "participant"
msgstr "participant"
#: apps/registration/forms.py:25 apps/registration/models.py:259
#: apps/registration/forms.py:24 apps/registration/models.py:259
msgid "coach"
msgstr "encadrant"
#: apps/registration/forms.py:35 apps/registration/forms.py:68
#: apps/registration/forms.py:34 apps/registration/forms.py:67
msgid "This email address is already used."
msgstr "Cette adresse e-mail est déjà utilisée."
#: apps/registration/forms.py:56 apps/registration/models.py:285
#: apps/registration/forms.py:55 apps/registration/models.py:285
msgid "volunteer"
msgstr "bénévole"
#: apps/registration/forms.py:57 apps/registration/models.py:304
#: apps/registration/forms.py:56 apps/registration/models.py:304
msgid "admin"
msgstr "admin"
#: apps/registration/forms.py:209
#: apps/registration/forms.py:208
msgid "Pending"
msgstr "En attente"
#: apps/registration/forms.py:225
#: apps/registration/forms.py:224
msgid "You must upload your scholarship attestation."
msgstr "Vous devez envoyer votre attestation de bourse."
@ -1414,8 +1407,8 @@ msgid "Your password has been set. You may go ahead and log in now."
msgstr "Votre mot de passe a été changé. Vous pouvez désormais vous connecter."
#: apps/registration/templates/registration/password_reset_complete.html:10
#: tfjm/templates/base.html:127 tfjm/templates/base.html:238
#: tfjm/templates/base.html:239 tfjm/templates/registration/login.html:7
#: tfjm/templates/base.html:127 tfjm/templates/base.html:244
#: tfjm/templates/base.html:245 tfjm/templates/registration/login.html:7
#: tfjm/templates/registration/login.html:8
#: tfjm/templates/registration/login.html:25
msgid "Log in"
@ -1652,7 +1645,7 @@ msgid "valid:"
msgstr "valide :"
#: apps/registration/templates/registration/user_detail.html:136
#: apps/registration/templates/registration/user_detail.html:184
#: apps/registration/templates/registration/user_detail.html:189
msgid "Update payment"
msgstr "Modifier le paiement"
@ -1664,18 +1657,22 @@ msgstr "Télécharger l'attestation de bourse"
msgid "Impersonate"
msgstr "Impersonifier"
#: apps/registration/templates/registration/user_detail.html:162
#: apps/registration/templates/registration/user_detail.html:161
msgid "Update user"
msgstr "Modifier l'utilisateur"
#: apps/registration/templates/registration/user_detail.html:167
#: apps/registration/views.py:313
msgid "Upload photo authorization"
msgstr "Téléverser l'autorisation de droit à l'image"
#: apps/registration/templates/registration/user_detail.html:167
#: apps/registration/templates/registration/user_detail.html:172
#: apps/registration/views.py:334
msgid "Upload health sheet"
msgstr "Téléverser la fiche sanitaire"
#: apps/registration/templates/registration/user_detail.html:172
#: apps/registration/templates/registration/user_detail.html:177
#: apps/registration/templates/registration/user_detail.html:182
#: apps/registration/views.py:355
msgid "Upload parental authorization"
msgstr "Téléverser l'autorisation parentale"
@ -1714,22 +1711,22 @@ msgstr "Détails de l'utilisateur {user}"
msgid "Update user {user}"
msgstr "Mise à jour de l'utilisateur {user}"
#: apps/registration/views.py:461
#: apps/registration/views.py:459
#, python-brace-format
msgid "Photo authorization of {student}.{ext}"
msgstr "Autorisation de droit à l'image de {student}.{ext}"
#: apps/registration/views.py:484
#: apps/registration/views.py:482
#, python-brace-format
msgid "Health sheet of {student}.{ext}"
msgstr "Fiche sanitaire de {student}.{ext}"
#: apps/registration/views.py:507
#: apps/registration/views.py:505
#, python-brace-format
msgid "Parental authorization of {student}.{ext}"
msgstr "Autorisation parentale de {student}.{ext}"
#: apps/registration/views.py:529
#: apps/registration/views.py:527
#, python-brace-format
msgid "Scholarship attestation of {user}.{ext}"
msgstr "Notification de bourse de {user}.{ext}"
@ -1854,15 +1851,15 @@ msgstr ""
"avez reçu par mail. Vous pouvez renvoyer un mail en cliquant sur <a href="
"\"%(send_email_url)s\">ce lien</a>."
#: tfjm/templates/base.html:183
#: tfjm/templates/base.html:189
msgid "Contact us"
msgstr "Nous contacter"
#: tfjm/templates/base.html:202
#: tfjm/templates/base.html:208
msgid "About"
msgstr "À propos"
#: tfjm/templates/base.html:225
#: tfjm/templates/base.html:231
msgid "Search results"
msgstr "Résultats de la recherche"
@ -1898,6 +1895,3 @@ msgstr "Résultats"
#: tfjm/templates/search/search.html:25
msgid "No results found."
msgstr "Aucun résultat."
#~ msgid "Update user"
#~ msgstr "Modifier l'utilisateur"

View File

@ -162,7 +162,13 @@
{% endblocktrans %}
</div>
{% endif %}
<div id="messages"></div>
<div id="messages">
<div class="alert alert-success">
Les inscriptions sont désormais ouvertes ! Si jamais vous aviez essayé de vous inscrire le 22 janvier,
il est possible que votre compte ait été supprimé. Vous pouvez désormais le recréer. Merci pour votre
patience, et bon TFJM² ! :)
</div>
</div>
<div id="content">
{% block content %}
<p>Default content...</p>

View File

@ -3,24 +3,6 @@
{% block content %}
<div>
<div class="alert alert-warning">
<p>
Certains d'entre vous rencontrent des difficultés lors de l'inscription. Quelques points :
<ul>
<li>Tout d'abord, il est inutile de créer plusieurs comptes.</li>
<li>Si vous ne recevez pas le mail de validation de l'adresse mail, vous pouvez quand même vous connecter.
Vous pourrez via un lien redemander un mail. Merci de ne pas spammer ce bouton toutefois. Pensez à vérifier
vos spams. Contactez-nous si vous ne recevez toujours rien.</li>
<li>Les différentes autorisations sont à soumettre sur la page de votre compte.</li>
<li>La date limite d'inscription est fixée en général à un mois avant le début du tournoi, soit début mars.
Le site <a href="https://tfjm.org/">https://tfjm.org/</a> sera mis à jour dans les jours qui suivent.</li>
</ul>
</p>
<p>
Une documentation plus complète sera disponible dans les jours à venir et régulièrement mise à jour pour apprendre à utiliser la plateforme.
</p>
</div>
<div class="jumbotron bg-white">
<div class="row">
<h1 class="display-3">