Avoid crash when deleting drafts
This commit is contained in:
parent
4dfbb61402
commit
d84aa0f3b9
@ -157,12 +157,15 @@ class Drafts(LoginRequiredMixin, View):
|
|||||||
for k in ['official_project_documents', 'other_documents',
|
for k in ['official_project_documents', 'other_documents',
|
||||||
'shapefiles']:
|
'shapefiles']:
|
||||||
|
|
||||||
|
try:
|
||||||
items = list(filter(
|
items = list(filter(
|
||||||
lambda x: (
|
lambda x: (
|
||||||
x['name'] == '{0}_files'.format(k)
|
x['name'] == '{0}_files'.format(k)
|
||||||
and x['value'] != ''
|
and x['value'] != ''
|
||||||
), data['data']['form']
|
), data['data']['form']
|
||||||
))
|
))
|
||||||
|
except KeyError:
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
items = items[0]['value'].split(',')
|
items = items[0]['value'].split(',')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user