Skip to content

Commit

Permalink
Add back in store_table
Browse files Browse the repository at this point in the history
  • Loading branch information
smk4664 committed Nov 26, 2024
1 parent a76540c commit 2cde99c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nautobot_golden_config/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2cde99c

Please sign in to comment.