Skip to content

Commit

Permalink
fix: import osm-fieldwork data_models via helper
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Oct 9, 2023
1 parent 596ff4e commit e4ad12f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from geojson import dump
from loguru import logger as log
from osm_fieldwork import basemapper
from osm_fieldwork.data_models import data_models_path
from osm_fieldwork.filter_data import FilterData
from osm_fieldwork.json2osm import json2osm
from osm_fieldwork.OdkCentral import OdkAppUser
Expand Down Expand Up @@ -1475,10 +1476,6 @@ def generate_appuser_files(
upload_custom_data_extracts(db, project_id, extracts_contents)

else:
import osm_fieldwork as of

rootdir = of.__path__[0]

project = (
db.query(db_models.DbProject)
.filter(db_models.DbProject.id == project_id)
Expand All @@ -1493,7 +1490,7 @@ def generate_appuser_files(
with open(config_path, "w", encoding="utf-8") as config_file_handle:
config_file_handle.write(config_file_contents.decode("utf-8"))
else:
config_path = f"{rootdir}/data_models/{category}.yaml"
config_path = f"{data_models_path}/{category}.yaml"

# # OSM Extracts for whole project
pg = PostgresClient("underpass", config_path)
Expand Down

0 comments on commit e4ad12f

Please sign in to comment.