mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-16 08:23:12 +00:00
[Printer] Prevent crashing when no file is given
This commit is contained in:
parent
3a3f2e0797
commit
62aef50c08
1 changed files with 8 additions and 7 deletions
|
@ -46,14 +46,15 @@ def new_job(request):
|
|||
View to create a new printing job
|
||||
"""
|
||||
if request.method == 'POST':
|
||||
if request.FILES:
|
||||
job_formset = formset_factory(JobWithOptionsForm)(
|
||||
request.POST,
|
||||
request.FILES,
|
||||
form_kwargs={'user': request.user},
|
||||
)
|
||||
job_formset = formset_factory(JobWithOptionsForm)(
|
||||
request.POST,
|
||||
request.FILES or None,
|
||||
form_kwargs={'user': request.user},
|
||||
)
|
||||
|
||||
tmp_job_formset = job_formset
|
||||
tmp_job_formset = job_formset
|
||||
|
||||
if request.FILES:
|
||||
|
||||
if job_formset.is_valid():
|
||||
files = request.FILES
|
||||
|
|
Loading…
Reference in a new issue