瀏覽代碼

CopyContent does not need to override render()

Jeremy Stretch 3 周之前
父節點
當前提交
5929c7cf1e
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      netbox/netbox/ui/actions.py

+ 4 - 6
netbox/netbox/ui/actions.py

@@ -148,10 +148,8 @@ class CopyContent(PanelAction):
         super().__init__(**kwargs)
         self.target_id = target_id
 
-    def render(self, context):
-        return render_to_string(self.template_name, {
+    def get_context(self, context):
+        return {
+            **super().get_context(context),
             'target_id': self.target_id,
-            'label': self.label,
-            'button_class': self.button_class,
-            'button_icon': self.button_icon,
-        })
+        }