Fix device editing

This commit is contained in:
Kumi 2019-02-07 15:11:32 +00:00
parent 6d4e69cb41
commit c48063179d

View file

@ -135,10 +135,10 @@ def editdevice(request, device_id):
if request.POST.get("subnet", ""):
subnet = Network.objects.get(intip=request.POST.get("subnet", device.network.intip if device.network else "No VPN"))
if subnet[0] in subnets:
if subnet in subnets:
newname = request.POST.get("name", "")
if newname != device.name:
sigRenameDevice(device.serial, request.user.username, device[0].name, newname)
sigRenameDevice(device.serial, request.user.username, device.name, newname)
device.name = newname
if subnet != device.network: