mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-17 09:12:18 -06:00
Closes #14861: Standardize URL path for virtual disks
This commit is contained in:
@@ -7,6 +7,7 @@ from django.http import HttpResponse
|
||||
from django.shortcuts import get_object_or_404, redirect, render
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import gettext as _
|
||||
from django.views.generic.base import RedirectView
|
||||
from jinja2.exceptions import TemplateError
|
||||
|
||||
from dcim.filtersets import DeviceFilterSet
|
||||
@@ -630,6 +631,15 @@ class VirtualDiskBulkDeleteView(generic.BulkDeleteView):
|
||||
table = tables.VirtualDiskTable
|
||||
|
||||
|
||||
# TODO: Remove in v4.2
|
||||
class VirtualDiskRedirectView(RedirectView):
|
||||
"""
|
||||
Redirect old (pre-v4.1) URLs for VirtualDisk views.
|
||||
"""
|
||||
def get_redirect_url(self, path):
|
||||
return f"{reverse('virtualization:virtualdisk_list')}{path}"
|
||||
|
||||
|
||||
#
|
||||
# Bulk Device component creation
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user