Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.9.5 [dev] #1694

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/apps/answers/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,25 +1235,25 @@ async def get_export_data( # noqa: C901
flows_coro = FlowsHistoryCRUD(self.session).get_by_id_versions(list(flow_hist_ids))
user_map_coro = AppletAccessCRUD(self.session).get_respondent_export_data(applet_id, list(respondent_ids))
subject_map_coro = AppletAccessCRUD(self.session).get_subject_export_data(applet_id, list(subject_ids))
current_user_subject_coro = SubjectsCrud(self.session).get_user_subject(self.user_id, applet_id) # type: ignore[arg-type]

coros_result = await asyncio.gather(
flows_coro,
user_map_coro,
subject_map_coro,
current_user_subject_coro,
return_exceptions=True,
)
for res in coros_result:
if isinstance(res, BaseException):
raise res

flows, user_map, subject_map, current_user = coros_result
flows, user_map, subject_map = coros_result
flow_map = {flow.id_version: flow for flow in flows} # type: ignore

for answer in answers:
respondent = user_map[answer.respondent_id] # type: ignore
answer.respondent_secret_id = current_user.secret_user_id # type: ignore
answer.respondent_secret_id = (
subject_map.get(answer.input_subject_id).secret_id if answer.input_subject_id else None # type: ignore
)

answer.source_secret_id = (
subject_map.get(answer.source_subject_id).secret_id if answer.source_subject_id else None # type: ignore
Expand Down
Loading