From abb7317597a1c9bd8acf2be46c9a031141edc5b2 Mon Sep 17 00:00:00 2001 From: John Glover Date: Tue, 21 Feb 2012 10:45:21 +0000 Subject: [PATCH] [1720][dictization] unflatten update - handle case where data already contains an unflattened list (eg: of extras) --- ckan/lib/navl/dictization_functions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ckan/lib/navl/dictization_functions.py b/ckan/lib/navl/dictization_functions.py index b3ebe1e6e21..822b29b142d 100644 --- a/ckan/lib/navl/dictization_functions.py +++ b/ckan/lib/navl/dictization_functions.py @@ -366,7 +366,9 @@ def unflatten(data): for flattend_key in sorted(data.keys(), key=flattened_order_key): current_pos = unflattened - if len(flattend_key) > 1 and not flattend_key[0] in convert_to_list: + if (len(flattend_key) > 1 + and not flattend_key[0] in convert_to_list + and not flattend_key[0] in unflattened): convert_to_list.append(flattend_key[0]) for key in flattend_key[:-1]: