Skip to content

Commit

Permalink
Fix export subject alteration (#62)
Browse files Browse the repository at this point in the history
* Subject Alteration had a bad concat that was throwing an error

* removing logs
  • Loading branch information
nathan-moore-97 authored Nov 28, 2023
1 parent 01e00ac commit 529c198
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 1 addition & 2 deletions qualtrix/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ def get_answer_from_result(result):
"fake_id_type": labels.get("QID12", None),
"spoof_artifact_type": labels.get("QID13", None),
"document_type": labels.get("QID15", None),
"subject_alterations": labels.get("QID17", "")
+ values.get("QID17_TEXT", ""),
"subject_alterations": labels.get("QID17", None),
"mask_type": labels.get("QID18", "") + values.get("QID18_4_TEXT", ""),
}
else:
Expand Down
14 changes: 11 additions & 3 deletions qualtrix/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
LOG_LEVEL = os.getenv("LOG_LEVEL", logging.getLevelName(logging.INFO))

API_TOKEN = None
BASE_URL = None
DIRECTORY_ID = None

try:
vcap_services = os.getenv("VCAP_SERVICES")
Expand All @@ -27,9 +29,15 @@
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["api_token"]
BASE_URL = config["base_url"]
DIRECTORY_ID = config["directory_id"]
else:
API_TOKEN = os.getenv("QX_API_TOKEN")
BASE_URL = os.getenv("QX_BASE_URL")
DIRECTORY_ID = os.getenv("QX_DIRECTORY_ID")


except (json.JSONDecodeError, KeyError, FileNotFoundError) as err:
log.warning("Unable to load credentials from VCAP_SERVICES")
log.debug("Error: %s", str(err))
Expand Down

0 comments on commit 529c198

Please sign in to comment.