summaryrefslogtreecommitdiffstats
path: root/provisioning-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2016-01-18 16:43:43 +0000
committerTed Trask <ttrask01@yahoo.com>2016-01-18 16:43:43 +0000
commit1d864192f8c91486b938b2ade2e1e148e80b66c9 (patch)
tree1185558a3d828878e93849e18087b38a542a644b /provisioning-model.lua
parent9ce48686e81f7ace3028a630c91795a8e76ea6a5 (diff)
downloadacf-provisioning-1d864192f8c91486b938b2ade2e1e148e80b66c9.tar.bz2
acf-provisioning-1d864192f8c91486b938b2ade2e1e148e80b66c9.tar.xz
Fix filter by device_id in listdevices
Diffstat (limited to 'provisioning-model.lua')
-rw-r--r--provisioning-model.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/provisioning-model.lua b/provisioning-model.lua
index d24e1af..eac1623 100644
--- a/provisioning-model.lua
+++ b/provisioning-model.lua
@@ -1563,7 +1563,15 @@ mymodule.list_devices = function(self, clientdata)
local filter = {}
for c,f in pairs(retval.value.filter.value) do
if columns[c] and f ~= "" then
- filter[#filter+1] = columns[c].."~'"..provdb.escape(f).."'"
+ if c == "device_id" then
+ if tonumber(f) then
+ filter[#filter+1] = columns[c].."='"..provdb.escape(f).."'"
+ else
+ filter[#filter+1] = columns[c].." IS NULL"
+ end
+ else
+ filter[#filter+1] = columns[c].."~'"..provdb.escape(f).."'"
+ end
end
end