mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 19:02:33 +00:00
Fix solution and synthesis forms
This commit is contained in:
parent
0576f3e32b
commit
d4c7b39f46
@ -154,7 +154,7 @@ class SolutionForm(forms.ModelForm):
|
|||||||
pages = len(pdf_reader.pages)
|
pages = len(pdf_reader.pages)
|
||||||
if pages > 30:
|
if pages > 30:
|
||||||
raise ValidationError(_("The PDF file must not have more than 30 pages."))
|
raise ValidationError(_("The PDF file must not have more than 30 pages."))
|
||||||
return self.cleaned_data["photo_authorization"]
|
return self.cleaned_data["file"]
|
||||||
|
|
||||||
def save(self, commit=True):
|
def save(self, commit=True):
|
||||||
"""
|
"""
|
||||||
@ -213,7 +213,7 @@ class SynthesisForm(forms.ModelForm):
|
|||||||
raise ValidationError(_("The uploaded file size must be under 2 Mo."))
|
raise ValidationError(_("The uploaded file size must be under 2 Mo."))
|
||||||
if file.content_type != "application/pdf":
|
if file.content_type != "application/pdf":
|
||||||
raise ValidationError(_("The uploaded file must be a PDF file."))
|
raise ValidationError(_("The uploaded file must be a PDF file."))
|
||||||
return self.cleaned_data["photo_authorization"]
|
return self.cleaned_data["file"]
|
||||||
|
|
||||||
def save(self, commit=True):
|
def save(self, commit=True):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user