diff --git a/portal/trigger_states/empro_states.py b/portal/trigger_states/empro_states.py index d0752ad9d7..6cd910966f 100644 --- a/portal/trigger_states/empro_states.py +++ b/portal/trigger_states/empro_states.py @@ -24,10 +24,10 @@ from ..models.questionnaire_bank import QuestionnaireBank from ..models.questionnaire_response import QuestionnaireResponse from ..models.observation import Observation +from ..models.research_study import EMPRO_RS_ID from ..models.user import User from ..timeout_lock import TimeoutLock -EMPRO_STUDY_ID = 1 EMPRO_LOCK_KEY = "empro-trigger-state-lock-{user_id}" @@ -317,7 +317,7 @@ def process_pending_actions(ts): # Withdrawn users should never receive reminders, nor staff # about them. qb_status = QB_Status( - user=patient, research_study_id=EMPRO_STUDY_ID, as_of_date=now) + user=patient, research_study_id=EMPRO_RS_ID, as_of_date=now) if qb_status.withdrawn_by(now): triggers = copy.deepcopy(ts.triggers) triggers['action_state'] = 'withdrawn' diff --git a/portal/views/user.py b/portal/views/user.py index 87837b4f3d..db2fb6b28d 100644 --- a/portal/views/user.py +++ b/portal/views/user.py @@ -37,6 +37,7 @@ from ..models.qb_timeline import QB_StatusCacheKey, invalidate_users_QBT from ..models.questionnaire_response import QuestionnaireResponse from ..models.relationship import Relationship +from ..models.research_study import EMPRO_RS_ID from ..models.role import ROLE, Role from ..models.table_preference import TablePreference from ..models.url_token import url_token @@ -962,8 +963,6 @@ def delete_user_consents(user_id): - ServiceToken: [] """ - from portal.trigger_states.empro_states import EMPRO_STUDY_ID - current_app.logger.debug('delete user consent called w/: {}'.format( request.json)) user = get_user(user_id, 'edit') @@ -983,7 +982,7 @@ def delete_user_consents(user_id): abort(404, "matching user consent not found") audit_comment = 'Deleted consent agreement' - if research_study_id == EMPRO_STUDY_ID: + if research_study_id == EMPRO_RS_ID: audit_comment = 'Deleted EMPRO consent agreement' remove_uc.deleted = Audit( user_id=current_user().id, subject_id=user_id,