From fdc879f00aabe6e604a7367f29717eaef6840a35 Mon Sep 17 00:00:00 2001 From: Brian Tiemann Date: Tue, 25 Feb 2025 14:11:11 -0500 Subject: [PATCH] Use a TemplateColumn for is_installed --- netbox/core/tables/plugins.py | 6 ++++-- netbox/core/tables/template_code.py | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/netbox/core/tables/plugins.py b/netbox/core/tables/plugins.py index 19962d7ca..43f46a4a6 100644 --- a/netbox/core/tables/plugins.py +++ b/netbox/core/tables/plugins.py @@ -2,6 +2,7 @@ import django_tables2 as tables from django.utils.translation import gettext_lazy as _ from netbox.tables import BaseTable, columns +from .template_code import PLUGIN_IS_INSTALLED __all__ = ( 'CatalogPluginTable', @@ -50,8 +51,9 @@ class CatalogPluginTable(BaseTable): is_local = columns.BooleanColumn( verbose_name=_('Local') ) - is_installed = columns.PluginActiveColumn( - verbose_name=_('Active') + is_installed = columns.TemplateColumn( + verbose_name=_('Active'), + template_code=PLUGIN_IS_INSTALLED ) is_certified = columns.BooleanColumn( verbose_name=_('Certified') diff --git a/netbox/core/tables/template_code.py b/netbox/core/tables/template_code.py index c8f0058e7..411574295 100644 --- a/netbox/core/tables/template_code.py +++ b/netbox/core/tables/template_code.py @@ -14,3 +14,13 @@ OBJECTCHANGE_OBJECT = """ OBJECTCHANGE_REQUEST_ID = """ {{ value }} """ + +PLUGIN_IS_INSTALLED = """ +{% if record.failed_to_load %} + +{% elif value is True %} + +{% else %} + +{% endif %} +"""