Allow empty strings again and fix #983

This commit is contained in:
emanuele-f 2017-02-15 12:05:24 +01:00
parent 7f48b1b4ad
commit 971e0e46af
2 changed files with 16 additions and 12 deletions

View file

@ -75,18 +75,20 @@ end
only_historical = false
local host_pool_id
if (isAdministrator() and (_POST["pool"] ~= nil)) then
host_pool_id = _POST["pool"]
local prev_pool = tostring(host["host_pool_id"])
if (host ~= nil) then
if (isAdministrator() and (_POST["pool"] ~= nil)) then
host_pool_id = _POST["pool"]
local prev_pool = tostring(host["host_pool_id"])
if host_pool_id ~= prev_pool then
local key = host2member(host["ip"], host["vlan"])
host_pools_utils.deletePoolMember(ifId, prev_pool, key)
host_pools_utils.addPoolMember(ifId, host_pool_id, key)
interface.reloadHostPools()
if host_pool_id ~= prev_pool then
local key = host2member(host["ip"], host["vlan"])
host_pools_utils.deletePoolMember(ifId, prev_pool, key)
host_pools_utils.addPoolMember(ifId, host_pool_id, key)
interface.reloadHostPools()
end
else
host_pool_id = tostring(host["host_pool_id"])
end
else
host_pool_id = tostring(host["host_pool_id"])
end
if(host == nil) then