From 2cde99c08553e02f9b8e4e2e6e701d33ffbdd038 Mon Sep 17 00:00:00 2001 From: Stephen Kiely Date: Tue, 26 Nov 2024 16:02:17 -0600 Subject: [PATCH] Add back in store_table --- nautobot_golden_config/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nautobot_golden_config/views.py b/nautobot_golden_config/views.py index 14693c39..e094ad66 100644 --- a/nautobot_golden_config/views.py +++ b/nautobot_golden_config/views.py @@ -252,12 +252,17 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.pk_list = None self.report_context = None + self.store_table = None # Used to store the table for bulk delete. No longer required in Nautobot 2.3.11 def get_extra_context(self, request, instance=None, **kwargs): """A ConfigCompliance helper function to warn if the Job is not enabled to run.""" context = super().get_extra_context(request, instance) if self.action == "overview": context = {**context, **self.report_context} + # TODO Remove when dropping support for Nautobot < 2.3.11 + if self.action == "bulk_destroy": + context["table"] = self.store_table + context["compliance"] = constant.ENABLE_COMPLIANCE context["backup"] = constant.ENABLE_BACKUP context["intended"] = constant.ENABLE_INTENDED @@ -312,6 +317,9 @@ def perform_bulk_destroy(self, request, **kwargs): ) return redirect(self.get_return_url(request)) + # TODO Remove when dropping support for Nautobot < 2.3.11 + self.store_table = table + if not request.POST.get("_all"): data.update({"table": table, "total_objs_to_delete": len(table.rows)}) else: