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
|
View to create a new printing job
|
||||||
"""
|
"""
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
if request.FILES:
|
job_formset = formset_factory(JobWithOptionsForm)(
|
||||||
job_formset = formset_factory(JobWithOptionsForm)(
|
request.POST,
|
||||||
request.POST,
|
request.FILES or None,
|
||||||
request.FILES,
|
form_kwargs={'user': request.user},
|
||||||
form_kwargs={'user': request.user},
|
)
|
||||||
)
|
|
||||||
|
|
||||||
tmp_job_formset = job_formset
|
tmp_job_formset = job_formset
|
||||||
|
|
||||||
|
if request.FILES:
|
||||||
|
|
||||||
if job_formset.is_valid():
|
if job_formset.is_valid():
|
||||||
files = request.FILES
|
files = request.FILES
|
||||||
|
|
Loading…
Reference in a new issue