From 36d03d85f3b10148ba343e8db8cfb6d723a9b686 Mon Sep 17 00:00:00 2001 From: Niraj Adhikari Date: Tue, 31 Oct 2023 17:48:25 +0545 Subject: [PATCH] hotfix: cleanData is called only if data extracts is available --- src/backend/app/projects/project_crud.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index 34c5b1b8c2..f73a664867 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -1524,9 +1524,13 @@ def generate_appuser_files( boundary = {"type": "Feature", "properties": {}, "geometry": outline} data_extract = pg.execQuery(boundary) filter = FilterData(xlsform) - filtered_data_extract = filter.cleanData(data_extract) updated_data_extract = {"type": "FeatureCollection", "features": []} + filtered_data_extract = ( + filter.cleanData(data_extract) + if data_extract + else updated_data_extract + ) # Collect feature mappings for bulk insert feature_mappings = []