mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 02:12:05 +01:00 
			
		
		
		
	Update validate team mail with a payment reminder
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
		@@ -5,16 +5,42 @@
 | 
				
			|||||||
    <title>Équipe validée – TFJM²</title>
 | 
					    <title>Équipe validée – TFJM²</title>
 | 
				
			||||||
</head>
 | 
					</head>
 | 
				
			||||||
<body>
 | 
					<body>
 | 
				
			||||||
Bonjour,<br/>
 | 
					<p>
 | 
				
			||||||
<br/>
 | 
					    Bonjour {{ registration }},
 | 
				
			||||||
Félicitations ! Votre équipe « {{ team.name }} » ({{ team.trigram }}) est désormais validée ! Vous êtes désormais apte
 | 
					</p>
 | 
				
			||||||
à travailler sur vos problèmes. Vous pourrez ensuite envoyer vos solutions sur la plateforme.<br>
 | 
					<p>
 | 
				
			||||||
Les organisateurs vous adressent ce message :<br/>
 | 
					    Félicitations ! Votre équipe « {{ team.name }} » ({{ team.trigram }}) est désormais validée ! Vous êtes désormais
 | 
				
			||||||
<br/>
 | 
					    apte à travailler sur vos problèmes. Vous pourrez ensuite envoyer vos solutions sur la plateforme.
 | 
				
			||||||
{{ message }}<br />
 | 
					</p>
 | 
				
			||||||
<br/>
 | 
					
 | 
				
			||||||
Cordialement,<br/>
 | 
					{% if payment %}
 | 
				
			||||||
<br/>
 | 
					    <p>
 | 
				
			||||||
 | 
					        Vous devez désormais vous acquitter de vos frais d'inscription, de {{ payment.amount }} € par élève.
 | 
				
			||||||
 | 
					        Vous pouvez payer par carte bancaire ou par virement bancaire. Vous trouverez les informations
 | 
				
			||||||
 | 
					        sur <a href="https://{{ domain }}{% url 'registration:update_payment' pk=payment.pk %}">la page de paiement</a>.
 | 
				
			||||||
 | 
					        Si vous disposez d'une bourse, l'inscription est gratuite, mais vous devez soumettre un justificatif
 | 
				
			||||||
 | 
					        sur la même page.
 | 
				
			||||||
 | 
					    </p>
 | 
				
			||||||
 | 
					{% elif registration.is_coach and team.participation.tournament.amount %}
 | 
				
			||||||
 | 
					    <p>
 | 
				
			||||||
 | 
					        Votre équipe doit désormais s'acquitter des frais d'inscription de {{ team.participation.tournament.amount }} €
 | 
				
			||||||
 | 
					        par élève (les encadrant⋅es sont exonéré⋅es). Les élèves qui disposent d'une bourse sont exonéré⋅es de ces frais.
 | 
				
			||||||
 | 
					        Vous pouvez suivre l'état des paiements sur
 | 
				
			||||||
 | 
					        <a href="https://{{ domain }}{% url 'participation:team_detail' pk=team.pk %}">la page de votre équipe</a>.
 | 
				
			||||||
 | 
					    </p>
 | 
				
			||||||
 | 
					{% endif %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{% if message %}
 | 
				
			||||||
 | 
					    <p>
 | 
				
			||||||
 | 
					        Les organisateur⋅ices vous adressent ce message :
 | 
				
			||||||
 | 
					    </p>
 | 
				
			||||||
 | 
					    <p>
 | 
				
			||||||
 | 
					        {{ message }}
 | 
				
			||||||
 | 
					    </p>
 | 
				
			||||||
 | 
					{% endif %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<p>
 | 
				
			||||||
    Le comité d'organisation du TFJM²
 | 
					    Le comité d'organisation du TFJM²
 | 
				
			||||||
 | 
					</p>
 | 
				
			||||||
</body>
 | 
					</body>
 | 
				
			||||||
</html>
 | 
					</html>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,12 +1,23 @@
 | 
				
			|||||||
Bonjour,
 | 
					Bonjour {{ registration }},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Félicitations ! Votre équipe « {{ team.name }} » ({{ team.trigram }}) est désormais validée ! Vous êtes désormais apte
 | 
					Félicitations ! Votre équipe « {{ team.name }} » ({{ team.trigram }}) est désormais validée ! Vous êtes désormais apte
 | 
				
			||||||
à travailler sur vos problèmes. Vous pourrez ensuite envoyer vos solutions sur la plateforme.
 | 
					à travailler sur vos problèmes. Vous pourrez ensuite envoyer vos solutions sur la plateforme.
 | 
				
			||||||
 | 
					{% if team.participation.amount %}
 | 
				
			||||||
Les organisateurs vous adressent ce message :
 | 
					Vous devez désormais vous acquitter de vos frais d'inscription, de {{ team.participation.amount }} €.
 | 
				
			||||||
 | 
					Vous pouvez payer par carte bancaire ou par virement bancaire. Vous trouverez les informations
 | 
				
			||||||
 | 
					sur la page de paiement que vous pouvez retrouver sur votre compte :
 | 
				
			||||||
 | 
					https://{{ domain }}{% url 'registration:my_account_detail' %}
 | 
				
			||||||
 | 
					Si vous disposez d'une bourse, l'inscription est gratuite, mais vous devez soumettre un justificatif
 | 
				
			||||||
 | 
					sur la même page.
 | 
				
			||||||
 | 
					{% elif registration.is_coach and team.participation.tournament.amount %}
 | 
				
			||||||
 | 
					Votre équipe doit désormais s'acquitter des frais d'inscription de {{ team.participation.tournament.amount }} €
 | 
				
			||||||
 | 
					par élève (les encadrant⋅es sont exonéré⋅es). Les élèves qui disposent d'une bourse sont exonéré⋅es de ces frais.
 | 
				
			||||||
 | 
					Vous pouvez suivre l'état des paiements sur la page de votre équipe :
 | 
				
			||||||
 | 
					https://{{ domain }}{% url 'participation:team_detail' pk=team.pk %}
 | 
				
			||||||
 | 
					{% endif %}
 | 
				
			||||||
 | 
					{% if message %}
 | 
				
			||||||
 | 
					Les organisateurices vous adressent ce message :
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{{ message }}
 | 
					{{ message }}
 | 
				
			||||||
 | 
					{% endif %}
 | 
				
			||||||
Cordialement,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Le comité d'organisation du TFJM²
 | 
					Le comité d'organisation du TFJM²
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -244,11 +244,18 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
 | 
				
			|||||||
        if "validate" in self.request.POST:
 | 
					        if "validate" in self.request.POST:
 | 
				
			||||||
            self.object.participation.valid = True
 | 
					            self.object.participation.valid = True
 | 
				
			||||||
            self.object.participation.save()
 | 
					            self.object.participation.save()
 | 
				
			||||||
            mail_context = dict(team=self.object, message=form.cleaned_data["message"])
 | 
					
 | 
				
			||||||
 | 
					            domain = Site.objects.first().domain
 | 
				
			||||||
 | 
					            for registration in self.object.participants.all():
 | 
				
			||||||
 | 
					                if registration.is_student and self.object.participation.tournament.amount:
 | 
				
			||||||
 | 
					                    payment = Payment.objects.get(registrations=registration, final=False)
 | 
				
			||||||
 | 
					                else:
 | 
				
			||||||
 | 
					                    payment = None
 | 
				
			||||||
 | 
					                mail_context = dict(domain=domain, registration=registration, team=self.object, payment=payment,
 | 
				
			||||||
 | 
					                                    message=form.cleaned_data["message"])
 | 
				
			||||||
                mail_plain = render_to_string("participation/mails/team_validated.txt", mail_context)
 | 
					                mail_plain = render_to_string("participation/mails/team_validated.txt", mail_context)
 | 
				
			||||||
                mail_html = render_to_string("participation/mails/team_validated.html", mail_context)
 | 
					                mail_html = render_to_string("participation/mails/team_validated.html", mail_context)
 | 
				
			||||||
            send_mail("[TFJM²] Équipe validée", mail_plain, None, [self.object.email], html_message=mail_html)
 | 
					                registration.user.email_user("[TFJM²] Équipe validée", mail_plain, html_message=mail_html)
 | 
				
			||||||
 | 
					 | 
				
			||||||
        elif "invalidate" in self.request.POST:
 | 
					        elif "invalidate" in self.request.POST:
 | 
				
			||||||
            self.object.participation.valid = None
 | 
					            self.object.participation.valid = None
 | 
				
			||||||
            self.object.participation.save()
 | 
					            self.object.participation.save()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user