diff --git a/src/backend/app/config.py b/src/backend/app/config.py index 56daa0f82a..daa77dc272 100644 --- a/src/backend/app/config.py +++ b/src/backend/app/config.py @@ -110,6 +110,7 @@ def assemble_db_connection(cls, v: Optional[str], info: FieldValidationInfo) -> OSM_SCOPE: str = "read_prefs" OSM_LOGIN_REDIRECT_URI: str = "http://127.0.0.1:8080/osmauth/" + UNDERPASS_API_URL: str = "https://raw-data-api0.hotosm.org/v1" SENTRY_DSN: Optional[str] = None model_config = SettingsConfigDict( diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index 3aa7a0db13..adc69cdc9b 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -581,7 +581,7 @@ def get_osm_extracts(boundary: str): else: query["geometry"] = json_boundary - base_url = "https://raw-data-api0.hotosm.org/v1" + base_url = settings.UNDERPASS_API_URL query_url = f"{base_url}/snapshot/" headers = {"accept": "application/json", "Content-Type": "application/json"} @@ -1394,7 +1394,7 @@ def generate_appuser_files( project_log.info(f"Extracting Data from OSM") # OSM Extracts for whole project - pg = PostgresClient("https://raw-data-api0.hotosm.org/v1", "underpass") + pg = PostgresClient(settings.UNDERPASS_API_URL, "underpass") # This file will store osm extracts outfile = f"/tmp/{prefix}_{xform_title}.geojson" @@ -2019,7 +2019,7 @@ async def update_project_form( db.commit() # OSM Extracts for whole project - pg = PostgresClient("https://raw-data-api0.hotosm.org/v1", "underpass") + pg = PostgresClient(settings.UNDERPASS_API_URL, "underpass") outfile = ( f"/tmp/{project_title}_{category}.geojson" # This file will store osm extracts ) diff --git a/src/backend/app/tasks/tasks_crud.py b/src/backend/app/tasks/tasks_crud.py index 21a9d48afb..5aaea42be7 100644 --- a/src/backend/app/tasks/tasks_crud.py +++ b/src/backend/app/tasks/tasks_crud.py @@ -40,6 +40,7 @@ from ..projects import project_crud from ..tasks import tasks_schemas from ..users import user_crud +from app.config import settings async def get_task_count_in_project(db: Session, project_id: int): @@ -330,7 +331,7 @@ async def update_task_files( task_polygons = f"/tmp/{project_name}_{category}_{task_id}.geojson" # Update data extracts in the odk central - pg = PostgresClient("https://raw-data-api0.hotosm.org/v1", "underpass") + pg = PostgresClient(settings.UNDERPASS_API_URL, "underpass") category = "buildings"