Commit 68ff2f04 authored by Hamza Dely's avatar Hamza Dely

[impressions] Indique à l'utilisateur que le PDF est invalide

parent 28f4aeed
......@@ -22,6 +22,7 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib import messages
# On importe l'utilitaire d'impression
from impression.base import FichierInvalide
from impression.impression_hp import impression
# Formulaires
......@@ -248,7 +249,11 @@ def view(request):
login_used = login
solde = get_solde(request)
jobs.append(impression(get_storage_path(login_used, filename), adh=login_used))
jobs.append(impression(get_storage_path(login_used, filename), adh=login_used))
except FichierInvalide:
messages.error(request, _(u"Le fichier ne semble pas être un PDF"))
return django.shortcuts.redirect("/impressions/")
# On met à jour les options et on envoie
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment