Skip to content

Commit b8421a0

Browse files
author
“Carmel
committed
Fix variables .get
1 parent 2e117ca commit b8421a0

2 files changed

Lines changed: 41 additions & 33 deletions

File tree

app.py

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def button1():
9999
try:
100100
new_subjects_ids = get_new_subjects(
101101
ldot_client,
102-
study_variables.get("ldot_study_id"),
103-
study_variables.get("eaid_qualtrics_survey_link_creation_to_do_date"),
104-
study_variables.get("eaid_qualtrics_survey_link_creation_completed"),
102+
study_variables.ldot_study_id,
103+
study_variables.eaid_qualtrics_survey_link_creation_to_do_date,
104+
study_variables.eaid_qualtrics_survey_link_creation_completed,
105105
)
106106
except QualtricsAPIError as e:
107107
return jsonify({"success": False, "message": str(e)}), 502
@@ -141,36 +141,36 @@ def button2():
141141

142142
debug_inputs = {
143143
"study_id": study_id,
144-
"ldot_study_id": study_variables.get("ldot_study_id"),
145-
"id_deelnemer_entity": study_variables.get("id_deelnemer_entity"),
146-
"id_location": study_variables.get("id_location"),
144+
"ldot_study_id": study_variables.ldot_study_id,
145+
"id_deelnemer_entity": study_variables.id_deelnemer_entity,
146+
"id_location": study_variables.id_location,
147147
"new_subject_ids": new_subject_ids,
148-
"qualtrics_survey_id": study_variables.get("qualtrics_survey_id"),
149-
"mailing_list_id": study_variables.get("mailing_list_id"),
150-
"embedded_data_field": study_variables.get("embedded_data_field"),
151-
"directory_id": study_variables.get("directory_id"),
152-
"distribution_id": study_variables.get("distribution_id"),
148+
"qualtrics_survey_id": study_variables.survey_id,
149+
"mailing_list_id": study_variables.mailing_list_id,
150+
"embedded_data_field": study_variables.embedded_data_field,
151+
"directory_id": study_variables.directory_id,
152+
"distribution_id": study_variables.distribution_id,
153153
}
154154

155155
try:
156156
subject_id_to_link_dict = add_individuals_to_survey(
157157
ldot_client,
158158
new_subject_ids,
159-
study_variables.get("ldot_study_id"),
160-
study_variables.get("id_deelnemer_entity"),
161-
study_variables.get("embedded_data_field"),
162-
study_variables.get("distribution_id"),
163-
study_variables.get("qualtrics_survey_id"),
164-
study_variables.get("mailing_list_id"),
165-
study_variables.get("directory_id"),
159+
study_variables.ldot_study_id,
160+
study_variables.id_deelnemer_entity,
161+
study_variables.embedded_data_field,
162+
study_variables.distribution_id,
163+
study_variables.survey_id,
164+
study_variables.mailing_list_id,
165+
study_variables.directory_id,
166166
)
167167
send_links_to_ldot(
168168
ldot_client,
169-
study_variables.get("ldot_study_id"),
170-
study_variables.get("id_deelnemer_entity"),
171-
study_variables.get("id_location"),
172-
study_variables.get("custom_var_qualtrics_link"),
173-
study_variables.get("eaid_qualtrics_survey_link_creation_completed"),
169+
study_variables.ldot_study_id,
170+
study_variables.id_deelnemer_entity,
171+
study_variables.id_location,
172+
study_variables.custom_var_qualtrics_link,
173+
study_variables.eaid_qualtrics_survey_link_creation_completed,
174174
subject_id_to_link_dict,
175175
)
176176
except QualtricsAPIError as e:
@@ -199,9 +199,9 @@ def button3():
199199
try:
200200
subjects_not_completed_survey = get_incomplete_subjects(
201201
ldot_client,
202-
study_variables.get("ldot_study_id"),
203-
study_variables.get("eaid_survey_invitation_completed"),
204-
study_variables.get("eaid_survey_progress_completed"),
202+
study_variables.ldot_study_id,
203+
study_variables.eaid_survey_invitation_completed,
204+
study_variables.eaid_survey_progress_completed,
205205
)
206206
message = f"Found {len(subjects_not_completed_survey)} subjects who have not completed the survey"
207207
return jsonify({"success": True, "message": message, "subject_ids": subjects_not_completed_survey})
@@ -229,12 +229,12 @@ def button4():
229229
try:
230230
participant_to_progress_dict = get_individual_progress(
231231
ldot_client,
232-
study_variables.get("ldot_study_id"),
233-
study_variables.get("id_deelnemer_entity"),
234-
study_variables.get("id_location"),
232+
study_variables.ldot_study_id,
233+
study_variables.id_deelnemer_entity,
234+
study_variables.id_location,
235235
subject_ids,
236-
study_variables.get("embedded_data_field"),
237-
study_variables.get("qualtrics_survey_id"),
236+
study_variables.embedded_data_field,
237+
study_variables.survey_id,
238238
)
239239
except QualtricsAPIError as e:
240240
return jsonify({"success": False, "message": str(e)}), 502
@@ -245,8 +245,8 @@ def button4():
245245
"success": True,
246246
"message": f"Retrieved progress for {len(participant_to_progress_dict)} subjects",
247247
"study_id": study_id,
248-
"qualtrics_survey_id": study_variables.get("qualtrics_survey_id"),
249-
"embedded_data_field": study_variables.get("embedded_data_field"),
248+
"qualtrics_survey_id": study_variables.survey_id,
249+
"embedded_data_field": study_variables.embedded_data_field,
250250
"progress_results": participant_to_progress_dict,
251251
})
252252

logs/api_calls.log

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,11 @@
8484
2026-07-10 15:11:56,018 | INFO | get_incomplete_subjects | Ldot GET response | url=https://accware.memic.maastrichtuniversity.nl/memic_ldot_api/api/v1.1/5c9c6a47-c8d7-8142-a8c8-ccdcb8a8044b/Action/337ecba2-3dd3-1141-8c38-6cffdcfbd7eb | status=200 | body={"Status": "succes", "Message": "Success", "Data": {"StudyEventActions": []}}
8585
2026-07-10 15:11:56,020 | INFO | get_incomplete_subjects | Ldot GET request | url=https://accware.memic.maastrichtuniversity.nl/memic_ldot_api/api/v1.1/5c9c6a47-c8d7-8142-a8c8-ccdcb8a8044b/Action/120d298d-9aa9-084b-abc6-432148db0e10 | params=null | json=null | data=null | stream=False
8686
2026-07-10 15:11:56,449 | INFO | get_incomplete_subjects | Ldot GET response | url=https://accware.memic.maastrichtuniversity.nl/memic_ldot_api/api/v1.1/5c9c6a47-c8d7-8142-a8c8-ccdcb8a8044b/Action/120d298d-9aa9-084b-abc6-432148db0e10 | status=200 | body={"Status": "succes", "Message": "Success", "Data": {"StudyEventActions": []}}
87+
2026-07-10 15:23:22,587 | INFO | get_new_subjects | Ldot GET request | url=https://accware.memic.maastrichtuniversity.nl/memic_ldot_api/api/v1.1/5c9c6a47-c8d7-8142-a8c8-ccdcb8a8044b/Action/5d31129c-d814-5d4b-a96f-048cadc150ce | params=null | json=null | data=null | stream=False
88+
2026-07-10 15:23:23,265 | INFO | get_new_subjects | Ldot GET response | url=https://accware.memic.maastrichtuniversity.nl/memic_ldot_api/api/v1.1/5c9c6a47-c8d7-8142-a8c8-ccdcb8a8044b/Action/5d31129c-d814-5d4b-a96f-048cadc150ce | status=200 | body={"Status": "succes", "Message": "Success", "Data": {"StudyEventActions": []}}
89+
2026-07-10 15:23:23,266 | INFO | get_new_subjects | Ldot GET request | url=https://accware.memic.maastrichtuniversity.nl/memic_ldot_api/api/v1.1/5c9c6a47-c8d7-8142-a8c8-ccdcb8a8044b/Action/31599192-8e9b-4341-b7f4-8b8967dd846a | params=null | json=null | data=null | stream=False
90+
2026-07-10 15:23:23,841 | INFO | get_new_subjects | Ldot GET response | url=https://accware.memic.maastrichtuniversity.nl/memic_ldot_api/api/v1.1/5c9c6a47-c8d7-8142-a8c8-ccdcb8a8044b/Action/31599192-8e9b-4341-b7f4-8b8967dd846a | status=200 | body={"Status": "succes", "Message": "Success", "Data": {"StudyEventActions": []}}
91+
2026-07-10 15:23:26,603 | INFO | get_incomplete_subjects | Ldot GET request | url=https://accware.memic.maastrichtuniversity.nl/memic_ldot_api/api/v1.1/5c9c6a47-c8d7-8142-a8c8-ccdcb8a8044b/Action/337ecba2-3dd3-1141-8c38-6cffdcfbd7eb | params=null | json=null | data=null | stream=False
92+
2026-07-10 15:23:27,239 | INFO | get_incomplete_subjects | Ldot GET response | url=https://accware.memic.maastrichtuniversity.nl/memic_ldot_api/api/v1.1/5c9c6a47-c8d7-8142-a8c8-ccdcb8a8044b/Action/337ecba2-3dd3-1141-8c38-6cffdcfbd7eb | status=200 | body={"Status": "succes", "Message": "Success", "Data": {"StudyEventActions": []}}
93+
2026-07-10 15:23:27,240 | INFO | get_incomplete_subjects | Ldot GET request | url=https://accware.memic.maastrichtuniversity.nl/memic_ldot_api/api/v1.1/5c9c6a47-c8d7-8142-a8c8-ccdcb8a8044b/Action/120d298d-9aa9-084b-abc6-432148db0e10 | params=null | json=null | data=null | stream=False
94+
2026-07-10 15:23:27,842 | INFO | get_incomplete_subjects | Ldot GET response | url=https://accware.memic.maastrichtuniversity.nl/memic_ldot_api/api/v1.1/5c9c6a47-c8d7-8142-a8c8-ccdcb8a8044b/Action/120d298d-9aa9-084b-abc6-432148db0e10 | status=200 | body={"Status": "succes", "Message": "Success", "Data": {"StudyEventActions": []}}

0 commit comments

Comments
 (0)