Skip to content

Commit 9e889cb

Browse files
hotfix : view mapswipe results
1 parent 999e1f7 commit 9e889cb

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

backend/core/views.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,16 +1415,13 @@ def retrieve(self, request, pk=None):
14151415
project_details = client.get_project_details(pk)
14161416
if project_details.get("status") == "FINISHED":
14171417
try:
1418-
1419-
if pred_inst.result :
1420-
if 'mapswipe' in pred_inst.result:
1421-
results = pred_inst.result
1418+
results = pred_inst.result or {}
1419+
if pred_inst.result and 'mapswipe' in pred_inst.result:
1420+
results = pred_inst.result
14221421
else :
1423-
results = {}
1424-
pred_inst.result = results
14251422
results_resp = client.get_project_results(pk)
14261423
results['mapswipe'] = results_resp
1427-
1424+
logging.info(f"Fetched MapSwipe results for project {pk}")
14281425
geojson_url = results_resp['exportAggregatedResultsWithGeometry']['file'].get("url", None)
14291426
if geojson_url :
14301427
task = process_mapswipe_results.apply_async(

backend/fairproject/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
INSTALLED_APPS = [
105105
"django.contrib.admin",
106106
"django.contrib.auth",
107+
"django.contrib.postgres",
107108
"django.contrib.contenttypes",
108109
"django.contrib.sessions",
109110
"django.contrib.messages",

0 commit comments

Comments
 (0)