mirror of
https://github.com/netbox-community/netbox.git
synced 2025-09-06 06:13:36 -06:00
fix(views): Remove generic AddObject from ObjectChildrenView
Registering the generic AddObject action on ObjectChildrenView results in duplicate "Add" buttons alongside the context‑specific add action (e.g., "Add Prefix"). The generic action also fails to pre-populate the parent context. Remove the generic registration so child lists show only the contextual add action provided by core views and plugins. Fixes #20252
This commit is contained in:
parent
47e4947ca0
commit
e987f73544
@ -15,7 +15,7 @@ from django.utils.translation import gettext as _
|
|||||||
|
|
||||||
from core.signals import clear_events
|
from core.signals import clear_events
|
||||||
from netbox.object_actions import (
|
from netbox.object_actions import (
|
||||||
AddObject, BulkDelete, BulkEdit, BulkExport, BulkImport, CloneObject, DeleteObject, EditObject,
|
BulkDelete, BulkEdit, BulkExport, BulkImport, CloneObject, DeleteObject, EditObject,
|
||||||
)
|
)
|
||||||
from utilities.error_handlers import handle_protectederror
|
from utilities.error_handlers import handle_protectederror
|
||||||
from utilities.exceptions import AbortRequest, PermissionsViolation
|
from utilities.exceptions import AbortRequest, PermissionsViolation
|
||||||
@ -103,7 +103,7 @@ class ObjectChildrenView(ObjectView, ActionsMixin, TableMixin):
|
|||||||
table = None
|
table = None
|
||||||
filterset = None
|
filterset = None
|
||||||
filterset_form = None
|
filterset_form = None
|
||||||
actions = (AddObject, BulkImport, BulkEdit, BulkExport, BulkDelete)
|
actions = (BulkImport, BulkEdit, BulkExport, BulkDelete)
|
||||||
template_name = 'generic/object_children.html'
|
template_name = 'generic/object_children.html'
|
||||||
|
|
||||||
def get_children(self, request, parent):
|
def get_children(self, request, parent):
|
||||||
|
Loading…
Reference in New Issue
Block a user