diff --git a/portal/trigger_states/empro_domains.py b/portal/trigger_states/empro_domains.py index d4a0ee81a..9390f5274 100644 --- a/portal/trigger_states/empro_domains.py +++ b/portal/trigger_states/empro_domains.py @@ -97,7 +97,8 @@ def eval(self): sequential_hard_trigger_count and self.previous_triggers and sequential_hard_trigger_count_key in self.previous_triggers): - sequential_hard_trigger_count = self.previous_triggers[sequential_hard_trigger_count_key] + 1 + sequential_hard_trigger_count = ( + self.previous_triggers[sequential_hard_trigger_count_key] + 1) self._triggers[sequential_hard_trigger_count_key] = sequential_hard_trigger_count diff --git a/portal/trigger_states/models.py b/portal/trigger_states/models.py index bbabb3c33..f32983cf3 100644 --- a/portal/trigger_states/models.py +++ b/portal/trigger_states/models.py @@ -366,7 +366,8 @@ def rebuild_trigger_states(patient): if not tl_query.count(): # User has no timeline data for EMPRO, likely not eligible if TriggerState.query.filter(TriggerState.user_id == patient.id).count(): - current_app.logging.error(f"no EMPRO timeline, yet trigger_states rows for {patient.id}") + current_app.logging.error( + f"no EMPRO timeline, yet trigger_states rows for {patient.id}") return # Capture state in memory for potential reuse when rebuilding diff --git a/tests/test_trigger_states.py b/tests/test_trigger_states.py index 43c74997a..fe5bee7f4 100644 --- a/tests/test_trigger_states.py +++ b/tests/test_trigger_states.py @@ -187,7 +187,7 @@ def test_apply_opt_out(initialized_patient, processed_ts, opt_out_submission): user = db.session.merge(initialized_patient) ts = users_trigger_state(user.id) result = ts.apply_opt_out(opt_out_submission) - found = [k for k,v in result.triggers['domain'].items() if opt_out_this_visit_key in v] + found = [k for k, v in result.triggers['domain'].items() if opt_out_this_visit_key in v] assert len(found) == 2