Skip to content

Commit

Permalink
fix: extra logs when extracting odk creds from proj/org
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Feb 26, 2024
1 parent 8601e43 commit 62c7554
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions src/backend/app/projects/project_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 62c7554

Please sign in to comment.