From 0d8384a5f2c8fb2baad20147266812c73595f0f6 Mon Sep 17 00:00:00 2001 From: adrian-turjak Date: Wed, 24 May 2017 15:49:22 +1200 Subject: [PATCH] Actions in detail view not working when approved * Due to the batch actions looking in the table for the actions the action would fail because tasks in the approved state would not be present in the default active table. * Adding a condition to get the correct table actions. Change-Id: Iac75ecc5ce91952e0f26746045113024aad6cbb2 --- adjutant_ui/content/tasks/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adjutant_ui/content/tasks/views.py b/adjutant_ui/content/tasks/views.py index c56ef89..40fd5a8 100644 --- a/adjutant_ui/content/tasks/views.py +++ b/adjutant_ui/content/tasks/views.py @@ -52,7 +52,10 @@ class TaskDetailView(tabs.TabView): return context def _get_actions(self, task): - table = task_tables.TaskTable(self.request) + if task.status == 'Approved; Incomplete': + table = task_tables.ApprovedTaskTable(self.request) + else: + table = task_tables.TaskTable(self.request) return table.render_row_actions(task) @memoized.memoized_method