Fix accessor shadowing in WirelessLinkInterfacePanel

Rename __init__ parameter from 'accessor' to 'interface_attr' to avoid
shadowing ObjectPanel.accessor, which would cause super().get_context()
to resolve the wrong context key.
This commit is contained in:
Jason Novinger
2026-03-11 14:32:30 -05:00
parent 2966384593
commit 5071a0f792

View File

@@ -28,16 +28,16 @@ class WirelessAuthenticationPanel(panels.ObjectAttributesPanel):
class WirelessLinkInterfacePanel(panels.ObjectPanel):
template_name = 'wireless/panels/wirelesslink_interface.html'
def __init__(self, accessor, title, **kwargs):
def __init__(self, interface_attr, title, **kwargs):
super().__init__(**kwargs)
self.accessor = accessor
self.interface_attr = interface_attr
self.title = title
def get_context(self, context):
obj = context['object']
return {
**super().get_context(context),
'interface': getattr(obj, self.accessor),
'interface': getattr(obj, self.interface_attr),
}