mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-09 00:58:16 -06:00
Merge 15c6296f91
into 475e0e6c1e
This commit is contained in:
commit
4586ad09bc
@ -35,6 +35,7 @@ from .models import (
|
|||||||
InventoryItem, Platform, PowerOutlet, PowerOutletTemplate, PowerPort, PowerPortTemplate, Rack, RackGroup,
|
InventoryItem, Platform, PowerOutlet, PowerOutletTemplate, PowerPort, PowerPortTemplate, Rack, RackGroup,
|
||||||
RackReservation, RackRole, Region, Site, VirtualChassis,
|
RackReservation, RackRole, Region, Site, VirtualChassis,
|
||||||
)
|
)
|
||||||
|
from re import sub
|
||||||
|
|
||||||
|
|
||||||
class BulkRenameView(View):
|
class BulkRenameView(View):
|
||||||
@ -59,7 +60,7 @@ class BulkRenameView(View):
|
|||||||
|
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
for obj in selected_objects:
|
for obj in selected_objects:
|
||||||
obj.new_name = obj.name.replace(form.cleaned_data['find'], form.cleaned_data['replace'])
|
obj.new_name = sub(form.cleaned_data['find'], form.cleaned_data['replace'], obj.name)
|
||||||
|
|
||||||
if '_apply' in request.POST:
|
if '_apply' in request.POST:
|
||||||
for obj in selected_objects:
|
for obj in selected_objects:
|
||||||
|
Loading…
Reference in New Issue
Block a user