Преглед изворни кода

Avoid setting mutable panel actions

Jeremy Stretch пре 4 дана
родитељ
комит
b91dc1243b
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      netbox/netbox/ui/panels.py

+ 4 - 1
netbox/netbox/ui/panels.py

@@ -53,7 +53,10 @@ class Panel:
     def __init__(self, title=None, actions=None):
     def __init__(self, title=None, actions=None):
         if title is not None:
         if title is not None:
             self.title = title
             self.title = title
-        self.actions = actions or self.actions or []
+        if actions is not None:
+            self.actions = actions
+        if self.actions is None:
+            self.actions = []
 
 
     def get_context(self, context):
     def get_context(self, context):
         """
         """