feat: support netbox-export 0.3.14 and netbox-reorder-rack 1.1.5
Verified against the actually installed versions that the patched hook signatures (serialize_object, is_exportable_model, _defer_device_placement, _device_placement_conflicts, _apply_device_placements, SaveViewSet.update, ReorderView.get) are still compatible with our wrappers, then added both versions to the supported sets so the width-aware patches stop being silently skipped. netbox-reorder-rack 1.1.5 changed ReorderView.get from (self, request, pk) to (self, request, **kwargs). Our fallback path called the original view with a positional pk, which would now raise TypeError; width_aware_reorder_get now accepts pk as a keyword with **kwargs passthrough so both the patched and native code paths work regardless of which signature is installed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,7 @@ from .rack_width import FULL_WIDTH, effective_width_positions, normalize_width_p
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
SUPPORTED_REORDER_RACK_VERSIONS = {"1.1.4"}
|
||||
SUPPORTED_REORDER_RACK_VERSIONS = {"1.1.4", "1.1.5"}
|
||||
PATCH_MARKER = "_netbox_utilities_bulk_save"
|
||||
VIEW_PATCH_MARKER = "_netbox_utilities_width_aware_view"
|
||||
GRID_COLUMNS = 12
|
||||
@@ -402,7 +402,7 @@ def bulk_reorder_update(self, request, pk=None):
|
||||
)
|
||||
|
||||
|
||||
def width_aware_reorder_get(self, request, pk):
|
||||
def width_aware_reorder_get(self, request, pk=None, **kwargs):
|
||||
"""Render every rack device server-side on the native Reorder page."""
|
||||
from dcim.choices import SubdeviceRoleChoices
|
||||
from django.conf import settings
|
||||
@@ -436,7 +436,7 @@ def width_aware_reorder_get(self, request, pk):
|
||||
if not width_data or not width_data.get("complete"):
|
||||
original_get = getattr(type(self), "_netbox_utilities_original_get", None)
|
||||
if original_get is not None:
|
||||
return original_get(self, request, pk)
|
||||
return original_get(self, request, pk=pk, **kwargs)
|
||||
raise Http404
|
||||
|
||||
return render(
|
||||
|
||||
Reference in New Issue
Block a user