Skip to content

Commit

Permalink
incorrect attribute access on previous_triggers.triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
pbugni committed Mar 19, 2024
1 parent 9d36f9e commit 9c29d3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion portal/trigger_states/empro_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ def eval_triggers(self, previous_triggers):

for domain in EMPRO_DOMAINS:
if domain in self.cur_obs:
prev_triggers_for_domain = previous_triggers["domain"][domain] if previous_triggers else None
prev_triggers_for_domain = (
previous_triggers["domain"].get(domain)
if previous_triggers else None)
dt = DomainTriggers(
domain=domain,
current_answers=self.cur_obs[domain],
Expand Down
2 changes: 1 addition & 1 deletion portal/trigger_states/empro_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def evaluate_triggers(qnr):
# bring together and evaluate available data for triggers
dm = DomainManifold(qnr)
previous_triggers = (
previous if previous and previous.visit_month + 1 == ts.visit_month
previous.triggers if previous and previous.visit_month + 1 == ts.visit_month
else None)
ts.triggers = dm.eval_triggers(previous_triggers)
ts.questionnaire_response_id = qnr.id
Expand Down

0 comments on commit 9c29d3b

Please sign in to comment.