mirror of https://git.48k.eu/ogcp
views: fix client update form crashing
Fix client update view crashing due to missing images variable. Check if GET /images fails.master
parent
02b6059c70
commit
4acb37d8c5
|
@ -1009,6 +1009,12 @@ def action_client_update():
|
|||
if setup and setup[0].get('code') == 'MSDOS':
|
||||
setup[0]['code'] = 'MBR'
|
||||
|
||||
r = server.get('/images')
|
||||
if r.status_code != requests.codes.ok:
|
||||
flash(_('ogServer: error retrieving images list'),
|
||||
category='error')
|
||||
return redirect(url_for('scopes'))
|
||||
images = r.json()['images']
|
||||
for entry in setup:
|
||||
if images and entry['image'] != 0:
|
||||
image = next((img for img in images if img['id'] == entry['image']), None)
|
||||
|
|
Loading…
Reference in New Issue