From a01ff3b88f9b2dd9163bc99e1bf72534839faa1c Mon Sep 17 00:00:00 2001 From: Maxime Bombar Date: Tue, 16 Oct 2018 13:47:52 +0200 Subject: [PATCH] [Printer] Propagate correctly ValidationError --- printer/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/printer/views.py b/printer/views.py index 011c20b5..883793c8 100644 --- a/printer/views.py +++ b/printer/views.py @@ -52,6 +52,8 @@ def new_job(request): form_kwargs={'user': request.user}, ) + tmp_job_formset = job_formset + if job_formset.is_valid(): files = request.FILES data = [] @@ -126,7 +128,7 @@ def new_job(request): request.session['jids']=jids return redirect('printer:payment') - raise Exception("Invalid Job_formset") + job_formset = tmp_job_formset else: job_formset = formset_factory(JobWithOptionsForm)(