diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index 77e3235adb..e27560b5d0 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -1149,8 +1149,10 @@ def generate_task_files( get_task_sync = async_to_sync(tasks_crud.get_task) task = get_task_sync(db, task_id) + odk_url = odk_credentials.odk_central_url + log.debug(f"Setting odk token for task ({task_id}) on server: {odk_url}") task.odk_token = encrypt_value( - f"{odk_credentials.odk_central_url}/v1/key/{appuser_token}/projects/{odk_id}" + f"{odk_url}/v1/key/{appuser_token}/projects/{odk_id}" ) # This file will store xml contents of an xls form. diff --git a/src/backend/app/projects/project_deps.py b/src/backend/app/projects/project_deps.py index 3cf6417ce4..400fee1d21 100644 --- a/src/backend/app/projects/project_deps.py +++ b/src/backend/app/projects/project_deps.py @@ -22,6 +22,7 @@ from fastapi import Depends from fastapi.exceptions import HTTPException +from loguru import logger as log from sqlalchemy.orm import Session from app.db.database import get_db @@ -78,6 +79,8 @@ async def get_odk_credentials(db: Session, project_id: int): user = creds.odk_central_user password = creds.odk_central_password + log.debug(f"Retrieved ODK creds for project ({project_id}): {url} | {user}") + return project_schemas.ODKCentralDecrypted( odk_central_url=url, odk_central_user=user,