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

Compare commits

..

2 Commits

Author SHA1 Message Date
Yohann D'ANELLO
bf32c34d4c Users should be able to send a synthesis during the fourth phase 2020-11-03 14:31:11 +01:00
Yohann D'ANELLO
c62aa3ebd1 Avoid infinite recursion 2020-11-03 14:26:55 +01:00
2 changed files with 2 additions and 3 deletions

View File

@ -95,7 +95,7 @@ class UploadVideoForm(forms.ModelForm):
fields = ('link',)
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."))
return super().clean()

View File

@ -179,7 +179,6 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
return self.handle_request_validation(form)
elif isinstance(form, ValidateParticipationForm):
return self.handle_validate_participation(form)
return self.form_invalid(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_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)
return self.form_valid(form)
return super().form_valid(form)
def handle_validate_participation(self, form):
"""