From a8e16a3388087d8d2adfae63d43f074f1f4d9960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20S=C3=A1nchez=20Parra?= Date: Mon, 20 Dec 2021 12:05:44 +0100 Subject: [PATCH] Check images list content in client details view Otherwise, client image assignation fails if "images" variable is empty. --- ogcp/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogcp/views.py b/ogcp/views.py index c05511b..114e768 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -582,7 +582,7 @@ def action_client_info(): setup = get_client_setup(ips) for entry in setup: - if entry['image'] != 0: + if images and entry['image'] != 0: image = next(img for img in images if img['id'] == entry['image']) entry['image'] = image['name'] else: