From e43405a3493e9dc4234a263eefe1b7fb0625c6c3 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Wed, 2 Nov 2016 18:43:36 +0100 Subject: [PATCH] Fix for empty File field not showing when there are no files Committing on behalf of Dr. Sybren --- pillar/web/nodes/routes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pillar/web/nodes/routes.py b/pillar/web/nodes/routes.py index c9b0ac1d..5948c366 100644 --- a/pillar/web/nodes/routes.py +++ b/pillar/web/nodes/routes.py @@ -362,8 +362,9 @@ def edit(node_id): # Extra entries are caused by min_entries=1 in the form # creation. field_list = form[prop_name] - while len(field_list) > len(db_prop_value): - field_list.pop_entry() + if len(db_prop_value): + while len(field_list): + field_list.pop_entry() for file_data in db_prop_value: file_form_class = build_file_select_form(subschema)