From c7048daf906ea6814d17ebeef0d8e27515270fad Mon Sep 17 00:00:00 2001 From: Paul Bugni Date: Mon, 26 Feb 2024 16:10:44 -0800 Subject: [PATCH] little off by one error; raised problems when user withdrew immediately after (or at same time as) consenting. --- portal/models/qb_timeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portal/models/qb_timeline.py b/portal/models/qb_timeline.py index 43399f420..25d3b8652 100644 --- a/portal/models/qb_timeline.py +++ b/portal/models/qb_timeline.py @@ -1166,7 +1166,7 @@ def attempt_update(user_id, research_study_id, invalidate_existing): if qbt.at > withdrawal_date: break j += 1 - if j > 1: + if j > 0: # include visit in withdrawn for qb_status functionality kwargs['qb_id'] = pending_qbts[j-1].qb_id kwargs['qb_iteration'] = pending_qbts[j-1].qb_iteration