mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-02-12 04:21:17 +00:00
Compare commits
2 Commits
4181742133
...
bf32c34d4c
Author | SHA1 | Date | |
---|---|---|---|
|
bf32c34d4c | ||
|
c62aa3ebd1 |
@ -95,7 +95,7 @@ class UploadVideoForm(forms.ModelForm):
|
|||||||
fields = ('link',)
|
fields = ('link',)
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
if Phase.current_phase().phase_number != 1 and self.instance.link:
|
if Phase.current_phase().phase_number != 1 and Phase.current_phase().phase_number != 4 and self.instance.link:
|
||||||
self.add_error("link", _("You can't upload your video after the deadline."))
|
self.add_error("link", _("You can't upload your video after the deadline."))
|
||||||
return super().clean()
|
return super().clean()
|
||||||
|
|
||||||
|
@ -179,7 +179,6 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
|
|||||||
return self.handle_request_validation(form)
|
return self.handle_request_validation(form)
|
||||||
elif isinstance(form, ValidateParticipationForm):
|
elif isinstance(form, ValidateParticipationForm):
|
||||||
return self.handle_validate_participation(form)
|
return self.handle_validate_participation(form)
|
||||||
return self.form_invalid(form)
|
|
||||||
|
|
||||||
def handle_request_validation(self, form):
|
def handle_request_validation(self, form):
|
||||||
"""
|
"""
|
||||||
@ -204,7 +203,7 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
|
|||||||
mail_plain = render_to_string("participation/mails/request_validation.txt", mail_context)
|
mail_plain = render_to_string("participation/mails/request_validation.txt", mail_context)
|
||||||
mail_html = render_to_string("participation/mails/request_validation.html", mail_context)
|
mail_html = render_to_string("participation/mails/request_validation.html", mail_context)
|
||||||
admin.user.email_user("[Corres2math] Validation d'équipe", mail_plain, html_message=mail_html)
|
admin.user.email_user("[Corres2math] Validation d'équipe", mail_plain, html_message=mail_html)
|
||||||
return self.form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
def handle_validate_participation(self, form):
|
def handle_validate_participation(self, form):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user