mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-09 19:36:27 +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,15 +46,16 @@ 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,
|
request.FILES or None,
|
||||||
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
|
||||||
data = []
|
data = []
|
||||||
|
|
Loading…
Reference in a new issue