Fix for empty File field not showing when there are no files

Committing on behalf of Dr. Sybren
This commit is contained in:
2016-11-02 18:43:36 +01:00
parent f394907dd2
commit e43405a349

View File

@@ -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)