mirror of https://git.48k.eu/ogcp
views: Fix bug in client detail with non existing images
Fix client detail form failing in some cases. It would fail if the user wanted to view the details of a client, that had a partition using an image that is no longer in the list of all images stored by the servers. This could happen if the image was deleted, but the client still was using the image in one of its partitionsmaster v1.1.3-10
parent
3c7e3e1e3b
commit
906c3070ed
|
@ -888,8 +888,11 @@ def action_client_info():
|
|||
|
||||
for entry in setup:
|
||||
if images and entry['image'] != 0:
|
||||
image = next(img for img in images if img['id'] == entry['image'])
|
||||
entry['image'] = image['name']
|
||||
image = next((img for img in images if img['id'] == entry['image']), None)
|
||||
if image:
|
||||
entry['image'] = image['name']
|
||||
else:
|
||||
entry['image'] = ""
|
||||
else:
|
||||
entry['image'] = ""
|
||||
|
||||
|
|
Loading…
Reference in New Issue