From 05475c2fa9784c6e790c9d068e3c81d151c64ba4 Mon Sep 17 00:00:00 2001 From: Anthony Belhadj Date: Mon, 18 Sep 2023 17:53:27 +0200 Subject: [PATCH] Improve operation display in Request list --- service_catalog/tables/request_tables.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/service_catalog/tables/request_tables.py b/service_catalog/tables/request_tables.py index 06308c67a..182b11fe6 100644 --- a/service_catalog/tables/request_tables.py +++ b/service_catalog/tables/request_tables.py @@ -21,12 +21,21 @@ class Meta: model = Request attrs = {"id": "request_table", "class": "table squest-pagination-tables"} fields = ("selection", "id", "user__username", "instance__quota_scope__name", - "instance__service", "operation", "state", "instance", "date_submitted", "last_updated") + "instance__service", "operation", "operation__type", "state", "instance", "date_submitted", + "last_updated") + + def render_operation__type(self, value, record): + from service_catalog.views import map_operation_type + return format_html( + f'{record.operation.type}') def render_id(self, value, record): return format_html(f'{record}') + def render_operation(self, value, record): + return value.name + def render_state(self, record, value): from service_catalog.views import map_request_state return format_html( - f'{value}') + f'{value}')