From 505c5e13e47d6e1717c23ef9a014e9025db8afca Mon Sep 17 00:00:00 2001 From: Maxime Bombar Date: Mon, 22 Oct 2018 01:15:29 +0200 Subject: [PATCH] [Printer] Fix bug in updating job object --- printer/views.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/printer/views.py b/printer/views.py index 5054fa1d..6f3fd139 100644 --- a/printer/views.py +++ b/printer/views.py @@ -128,10 +128,19 @@ def new_job(request): ) if job_formset.is_valid(): for job_form in job_formset: - jid = job_form.cleaned_data['jid'] + data = job_form.cleaned_data + jid = data['jid'] job = JobWithOptions.objects.get(id=jid) job.user = request.user job.status = 'Printable' + if data['printAs']: + job.printAs = data['printAs'] + job.format = data['format'] + job.color = data['color'] + job.disposition = data['disposition'] + job.count = data['count'] + job.stapling = data['stapling'] + job.perforation = data['perforation'] job._update_price() job.save() return redirect('printer:payment')