mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 14:38:24 +02:00
More specific code to ETEAM
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -111,7 +111,7 @@ class RequestValidationForm(forms.Form):
|
||||
)
|
||||
|
||||
engagement = forms.BooleanField(
|
||||
label=_("I engage myself to participate to the whole TFJM²."),
|
||||
label=_("I engage myself to participate to the whole tournament."),
|
||||
required=True,
|
||||
)
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
# Copyright (C) 2020 by Animath
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
import math
|
||||
|
||||
from datetime import date, timedelta
|
||||
import math
|
||||
import os
|
||||
|
||||
from django.conf import settings
|
||||
@ -27,7 +28,7 @@ def get_motivation_letter_filename(instance, filename):
|
||||
|
||||
class Team(models.Model):
|
||||
"""
|
||||
The Team model represents a real team that participates to the TFJM².
|
||||
The Team model represents a real team that participates to the tournament.
|
||||
This only includes the registration detail.
|
||||
"""
|
||||
name = models.CharField(
|
||||
|
@ -15,10 +15,10 @@
|
||||
|
||||
{% if payment %}
|
||||
<p>
|
||||
You must now pay your participation fee of € {{ team.participation.amount }}.
|
||||
You must now pay your participation fee of € {{ payment.amount }}.
|
||||
You can pay by credit card or bank transfer. You'll find information
|
||||
on the payment page which you can find on
|
||||
<a href="https://{{ domain }}{% url 'registration:my_account_detail' %}"your account</a>.
|
||||
<a href="https://{{ domain }}{% url 'registration:my_account_detail' %}">your account</a>.
|
||||
If you have a scholarship, registration is free, but you must submit a justification on the same page.
|
||||
</p>
|
||||
{% elif registration.is_coach and team.participation.tournament.price %}
|
||||
|
@ -2,8 +2,8 @@ Hello {{registration }},
|
||||
|
||||
Congratulations! Your team "{{ team.name }}" ({{ team.trigram }}) is now validated! You are now ready to
|
||||
to work on your problems. You can then upload your solutions to the platform.
|
||||
{% if team.participation.amount %}
|
||||
You must now pay your participation fee of € {{ team.participation.amount }}.
|
||||
{% if payment %}
|
||||
You must now pay your participation fee of € {{ payment.amount }}.
|
||||
You can pay by credit card or bank transfer. You'll find information
|
||||
on the payment page which you can find on your account:
|
||||
https://{{ domain }}{% url 'registration:my_account_detail' %}
|
||||
|
@ -231,7 +231,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(f"[{settings.APP_NAME}] {_('Team validation')}", mail_plain, settings.DEFAULT_FROM_EMAIL,
|
||||
[self.object.participation.tournament.organizers_email], html_message=mail_html)
|
||||
|
||||
return super().form_valid(form)
|
||||
@ -255,7 +255,8 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
|
||||
|
||||
domain = Site.objects.first().domain
|
||||
for registration in self.object.participants.all():
|
||||
if registration.is_student and self.object.participation.tournament.price:
|
||||
if settings.PAYMENT_MANAGEMENT and \
|
||||
registration.is_student and self.object.participation.tournament.price:
|
||||
payment = Payment.objects.get(registrations=registration, final=False)
|
||||
else:
|
||||
payment = None
|
||||
@ -265,7 +266,8 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
|
||||
message=form.cleaned_data["message"].replace('\n', '<br>'))
|
||||
mail_plain = render_to_string("participation/mails/team_validated.txt", mail_context_plain)
|
||||
mail_html = render_to_string("participation/mails/team_validated.html", mail_context_html)
|
||||
registration.user.email_user("[TFJM²] Équipe validée", mail_plain, html_message=mail_html)
|
||||
registration.user.email_user(f"[{settings.APP_NAME}] {_('Team validated')}", mail_plain,
|
||||
html_message=mail_html)
|
||||
elif "invalidate" in self.request.POST:
|
||||
self.object.participation.valid = None
|
||||
self.object.participation.save()
|
||||
@ -273,8 +275,8 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
|
||||
mail_context_html = dict(team=self.object, message=form.cleaned_data["message"].replace('\n', '<br>'))
|
||||
mail_plain = render_to_string("participation/mails/team_not_validated.txt", mail_context_plain)
|
||||
mail_html = render_to_string("participation/mails/team_not_validated.html", mail_context_html)
|
||||
send_mail("[TFJM²] Équipe non validée", mail_plain, None, [self.object.email],
|
||||
html_message=mail_html)
|
||||
send_mail(f"[{settings.APP_NAME}] {_('Team not validated')}", mail_plain,
|
||||
None, [self.object.email], html_message=mail_html)
|
||||
else:
|
||||
form.add_error(None, _("You must specify if you validate the registration or not."))
|
||||
return self.form_invalid(form)
|
||||
@ -1135,7 +1137,7 @@ class PoolJuryView(VolunteerMixin, FormView, DetailView):
|
||||
user.save()
|
||||
|
||||
# Send welcome mail
|
||||
subject = "[TFJM²] " + str(_("New TFJM² jury account"))
|
||||
subject = f"[{settings.APP_NAME}] " + str(_("New jury account"))
|
||||
site = Site.objects.first()
|
||||
message = render_to_string('registration/mails/add_organizer.txt', dict(user=user,
|
||||
inviter=self.request.user,
|
||||
|
Reference in New Issue
Block a user