From fc6e2593b440c544abda08c0a73e2baf02de9caf Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Wed, 29 Mar 2023 18:34:55 +0200 Subject: [PATCH] PdfFileReader is deprecated, replace by PdfReader --- apps/participation/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/participation/forms.py b/apps/participation/forms.py index 723e7e1..b128c80 100644 --- a/apps/participation/forms.py +++ b/apps/participation/forms.py @@ -11,7 +11,7 @@ from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.validators import FileExtensionValidator from django.utils.translation import gettext_lazy as _ -from pypdf import PdfFileReader +from pypdf import PdfReader from .models import Note, Participation, Passage, Pool, Solution, Synthesis, Team, Tournament @@ -151,7 +151,7 @@ class SolutionForm(forms.ModelForm): raise ValidationError(_("The uploaded file size must be under 5 Mo.")) if file.content_type != "application/pdf": raise ValidationError(_("The uploaded file must be a PDF file.")) - pdf_reader = PdfFileReader(file) + pdf_reader = PdfReader(file) pages = len(pdf_reader.pages) if pages > 30: raise ValidationError(_("The PDF file must not have more than 30 pages."))