1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #211: Allow device assignment and removal from IP address view

This commit is contained in:
Jeremy Stretch
2016-10-24 15:07:11 -04:00
parent f44a322df5
commit e22eafc4a7
8 changed files with 182 additions and 7 deletions

View File

@@ -1715,7 +1715,7 @@ class InterfaceConnectionsListView(ObjectListView):
# IP addresses
#
@permission_required('ipam.add_ipaddress')
@permission_required(['dcim.change_device', 'ipam.add_ipaddress'])
def ipaddress_assign(request, pk):
device = get_object_or_404(Device, pk=pk)
@@ -1727,8 +1727,7 @@ def ipaddress_assign(request, pk):
ipaddress = form.save(commit=False)
ipaddress.interface = form.cleaned_data['interface']
ipaddress.save()
messages.success(request, "Added new IP address {0} to interface {1}".format(ipaddress,
ipaddress.interface))
messages.success(request, "Added new IP address {} to interface {}".format(ipaddress, ipaddress.interface))
if form.cleaned_data['set_as_primary']:
if ipaddress.family == 4: