Skip to content

Commit

Permalink
CR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-moore-97 committed Jan 11, 2024
1 parent 1133624 commit 8f52d1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions qualtrix/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import fastapi
from fastapi import HTTPException
from pydantic import BaseModel, typing
from pydantic import BaseModel

from qualtrix import client, error, settings

Expand Down Expand Up @@ -49,8 +49,8 @@ async def get_response(request: ResponseModel):
async def get_redirect(request: RedirectModel):
try:
email = client.get_email(request.surveyId, request.responseId)
contact = client.get_contact(settings.directory_id, email)
distribution = client.get_distribution(settings.directory_id, contact["id"])
contact = client.get_contact(settings.DIRECTORY_ID, email)
distribution = client.get_distribution(settings.DIRECTORY_ID, contact["id"])
return client.get_link(request.targetSurveyId, distribution["distributionId"])
except error.QualtricsError as e:
logging.error(e)
Expand Down
12 changes: 6 additions & 6 deletions qualtrix/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
log.info("Loading credentials from env var")
config = service["credentials"]
break
API_TOKEN = config["api_token"]
BASE_URL = config["base_url"]
DIRECTORY_ID = config["directory_id"]
API_TOKEN = config["apiToken"]
BASE_URL = config["baseUrl"]
DIRECTORY_ID = config["directoryId"]
else:
API_TOKEN = os.getenv("QX_API_TOKEN")
BASE_URL = os.getenv("QX_BASE_URL")
DIRECTORY_ID = os.getenv("QX_DIRECTORY_ID")
API_TOKEN = os.getenv("QUALTRIX_API_TOKEN")
BASE_URL = os.getenv("QUALTRIX_BASE_URL")
DIRECTORY_ID = os.getenv("QUALTRIX_DIRECTORY_ID")


except (json.JSONDecodeError, KeyError, FileNotFoundError) as err:
Expand Down

0 comments on commit 8f52d1a

Please sign in to comment.