Skip to content

Commit

Permalink
revise fix for duplicate submission uuids to instead use deepcopy so …
Browse files Browse the repository at this point in the history
…that uuids are not directly mutated
  • Loading branch information
RuthShryock committed Jul 26, 2024
1 parent 38b2a64 commit d6e5e98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kobo/apps/subsequences/tests/test_submission_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def test_stream_with_extras_handles_duplicated_submission_uuids(self):

# Process submissions with extras
try:
output = list(
_ = list(
stream_with_extras(
self.asset.deployment.get_submissions(
user=self.asset.owner
Expand Down
4 changes: 1 addition & 3 deletions kobo/apps/subsequences/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def stream_with_extras(submission_stream, asset):
uuid = submission[SUBMISSION_UUID_FIELD]
else:
uuid = submission['_uuid']
all_supplemental_details = extras.get(uuid, {})
all_supplemental_details = deepcopy(extras.get(uuid, {}))
for qpath, supplemental_details in all_supplemental_details.items():
try:
all_qual_responses = supplemental_details['qual']
Expand All @@ -176,8 +176,6 @@ def stream_with_extras(submission_stream, asset):
val = [val]
val_expanded = []
for v in val:
if isinstance(v, dict):
v = v['uuid']
try:
v_ex = qual_choices_per_question_by_uuid[
qual_q['uuid']
Expand Down

0 comments on commit d6e5e98

Please sign in to comment.