mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 05:42:23 +00:00
Syntheses must not exceed 2 pages
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
3333add7e0
commit
20daecf619
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: TFJM\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-05-20 11:44+0200\n"
|
||||
"POT-Creation-Date: 2023-05-20 17:09+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Emmy D'Anello <emmy.danello@animath.fr>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -564,6 +564,10 @@ msgstr ""
|
||||
msgid "This defender did not work on this problem."
|
||||
msgstr "Ce⋅tte défenseur⋅se ne travaille pas sur ce problème."
|
||||
|
||||
#: participation/forms.py:357
|
||||
msgid "The PDF file must not have more than 2 pages."
|
||||
msgstr "Le fichier PDF ne doit pas avoir plus de 2 pages."
|
||||
|
||||
#: participation/models.py:33 participation/models.py:136
|
||||
#: participation/tables.py:17 participation/tables.py:33
|
||||
msgid "name"
|
||||
|
@ -351,6 +351,10 @@ class SynthesisForm(forms.ModelForm):
|
||||
raise ValidationError(_("The uploaded file size must be under 2 Mo."))
|
||||
if file.content_type != "application/pdf":
|
||||
raise ValidationError(_("The uploaded file must be a PDF file."))
|
||||
pdf_reader = PdfReader(file)
|
||||
pages = len(pdf_reader.pages)
|
||||
if pages > 2:
|
||||
raise ValidationError(_("The PDF file must not have more than 2 pages."))
|
||||
return self.cleaned_data["file"]
|
||||
|
||||
def save(self, commit=True):
|
||||
|
Loading…
Reference in New Issue
Block a user