From dd7d7092a603f64229d950e09d6633eda61d7826 Mon Sep 17 00:00:00 2001 From: James Curtis Date: Mon, 13 Jul 2020 12:48:43 +0100 Subject: [PATCH] [FIX] Printing report unable to handle a cancelled task As tasks can now be cancelled by the system (for being to old), the NEWS report needs to be able to handle a task that was cancelled. Fixes #16517 --- nh_eobs_mental_health/report/refused_observations.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nh_eobs_mental_health/report/refused_observations.py b/nh_eobs_mental_health/report/refused_observations.py index b661f1f9..6431a9ba 100644 --- a/nh_eobs_mental_health/report/refused_observations.py +++ b/nh_eobs_mental_health/report/refused_observations.py @@ -217,6 +217,8 @@ def get_task_column_data(self, refusal_episode, 'date_terminated': date_terminated, 'user_id': user.name } + elif review_state == 'cancelled': + return 'Task Cancelled' raise ValueError( "Unexpected state '{}' for {} task.".format( review_state, task_name.title())