1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-02-26 17:46:27 +00:00

Compare commits

..

No commits in common. "fc6e2593b440c544abda08c0a73e2baf02de9caf" and "57bddc5628013b48b9bddd413fdee85554943542" have entirely different histories.

2 changed files with 3 additions and 3 deletions

View File

@ -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 PdfReader
from pypdf import PdfFileReader
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 = PdfReader(file)
pdf_reader = PdfFileReader(file)
pages = len(pdf_reader.pages)
if pages > 30:
raise ValidationError(_("The PDF file must not have more than 30 pages."))

View File

@ -95,7 +95,7 @@
<a class="nav-link" href="{% url "participation:chat" %}">
<i class="fas fa-comments"></i> {% trans "Chat" %}</a>
</li>
{% if user.registration.is_admin %}
{% if user.admin %}
<li class="nav-item active">
<a class="nav-link" href="{% url "admin:index" %}"><i class="fas fa-cog"></i> {% trans "Administration" %}</a>
</li>