Fixes #5078: Fix assignment of existing IP addresses to interfaces via web UI

This commit is contained in:
Jeremy Stretch
2020-09-01 10:19:28 -04:00
parent 967073eaaf
commit 7dbeaf7a01
3 changed files with 4 additions and 7 deletions

View File

@@ -582,7 +582,7 @@ class IPAddressAssignView(ObjectView):
def dispatch(self, request, *args, **kwargs):
# Redirect user if an interface has not been provided
if 'interface' not in request.GET:
if 'interface' not in request.GET and 'vminterface' not in request.GET:
return redirect('ipam:ipaddress_add')
return super().dispatch(request, *args, **kwargs)
@@ -609,7 +609,7 @@ class IPAddressAssignView(ObjectView):
return render(request, 'ipam/ipaddress_assign.html', {
'form': form,
'table': table,
'return_url': request.GET.get('return_url', ''),
'return_url': request.GET.get('return_url'),
})