diff --git a/onadata/libs/tests/utils/test_export_tools.py b/onadata/libs/tests/utils/test_export_tools.py index a22a7bbf7f..bd6abd2a5a 100644 --- a/onadata/libs/tests/utils/test_export_tools.py +++ b/onadata/libs/tests/utils/test_export_tools.py @@ -295,6 +295,7 @@ def test_get_query_params_from_metadata_fn(self): { "title": "start", "fields": "", + "simple_style": None, "geo_field": "qn09", }, get_query_params_from_metadata(metadata), @@ -307,9 +308,10 @@ def test_get_query_params_from_metadata_fn(self): } self.assertEqual( { - "title": "start", "fields": "one,two", "geo_field": "qn09", + "simple_style": None, + "title": "start", }, get_query_params_from_metadata(metadata), ) diff --git a/onadata/libs/utils/export_tools.py b/onadata/libs/utils/export_tools.py index 558ff2b239..1d76c5e64a 100644 --- a/onadata/libs/utils/export_tools.py +++ b/onadata/libs/utils/export_tools.py @@ -649,17 +649,11 @@ def get_query_params_from_metadata(metadata): return None extra_data = metadata.extra_data - keys_mapping = { - "data_geo_field": "geo_field", - "data_simple_style": "simple_style", - "data_title": "title", - "data_fields": "fields", - } - return { - mapped_key: extra_data[original_key] - for original_key, mapped_key in keys_mapping.items() - if original_key in extra_data + "geo_field": extra_data.get("data_geo_field"), + "simple_style": extra_data.get("data_simple_style"), + "title": extra_data.get("data_title"), + "fields": extra_data.get("data_fields"), }