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

Add parental and photo authorizations + make health and vaccine sheet and motivation letter optional

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-06-07 17:20:06 +02:00
parent ea03bd314b
commit e026f49f8d
13 changed files with 316 additions and 88 deletions

View File

@ -3,6 +3,7 @@
from datetime import date, datetime
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.mail import send_mail
from django.core.validators import MaxValueValidator, MinValueValidator
@ -307,7 +308,7 @@ class ParticipantRegistration(Registration):
"""
The team is selected for final.
"""
translation.activate('fr')
translation.activate(settings.PREFERRED_LANGUAGE_CODE)
subject = "[TFJM²] " + str(_("Team selected for the final tournament"))
site = Site.objects.first()
from participation.models import Tournament
@ -425,7 +426,7 @@ class StudentRegistration(ParticipantRegistration):
'priority': 5,
'content': content,
})
if not self.health_sheet:
if settings.HEALTH_SHEET_REQUIRED and not self.health_sheet:
text = _("You have not uploaded your health sheet. "
"You can do it by clicking on <a href=\"{health_url}\">this link</a>.")
health_url = reverse_lazy("registration:upload_user_health_sheet", args=(self.id,))
@ -436,7 +437,7 @@ class StudentRegistration(ParticipantRegistration):
'priority': 5,
'content': content,
})
if not self.vaccine_sheet:
if settings.VACCINE_SHEET_REQUIRED and not self.vaccine_sheet:
text = _("You have not uploaded your vaccine sheet. "
"You can do it by clicking on <a href=\"{vaccine_url}\">this link</a>.")
vaccine_url = reverse_lazy("registration:upload_user_vaccine_sheet", args=(self.id,))
@ -801,7 +802,7 @@ class Payment(models.Model):
return checkout_intent
def send_remind_mail(self):
translation.activate('fr')
translation.activate(settings.PREFERRED_LANGUAGE_CODE)
subject = "[TFJM²] " + str(_("Reminder for your payment"))
site = Site.objects.first()
for registration in self.registrations.all():
@ -812,7 +813,7 @@ class Payment(models.Model):
registration.user.email_user(subject, message, html_message=html)
def send_helloasso_payment_confirmation_mail(self):
translation.activate('fr')
translation.activate(settings.PREFERRED_LANGUAGE_CODE)
subject = "[TFJM²] " + str(_("Payment confirmation"))
site = Site.objects.first()
for registration in self.registrations.all():