1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-07-08 15:30:19 +02:00

Don't upload videos after the deadline

This commit is contained in:
Yohann D'ANELLO
2020-10-20 14:51:09 +02:00
parent ab315a69ed
commit 9159e7323d
3 changed files with 16 additions and 1 deletions

View File

@ -74,6 +74,11 @@ class UploadVideoForm(forms.ModelForm):
model = Video
fields = ('link',)
def clean(self):
if Phase.current_phase().phase_number != 1 and self.instance.link:
self.add_error("link", _("You can't upload your video after the deadline."))
return super().clean()
class PhaseForm(forms.ModelForm):
class Meta: