From f0ccd85ac609d63eedd0721dbcbc2257665aefc1 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 4 Mar 2011 14:15:45 +0000 Subject: Fail to create / update device if no classes selected --- provisioning-listdevices-html.lsp | 4 ++-- provisioning-model.lua | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/provisioning-listdevices-html.lsp b/provisioning-listdevices-html.lsp index 17fee89..47c01cf 100644 --- a/provisioning-listdevices-html.lsp +++ b/provisioning-listdevices-html.lsp @@ -7,7 +7,7 @@ require("viewfunctions") <% displaycommandresults({"deletedevice", "editdevice", "editdeviceparams", "overridedeviceparams"}, session) %> -<% -- handled above displaycommandresults({"createdevice"}, session, true) %> +<% displaycommandresults({"createdevice"}, session, true) %>

Devices

diff --git a/provisioning-model.lua b/provisioning-model.lua index 8f2470a..0c29426 100644 --- a/provisioning-model.lua +++ b/provisioning-model.lua @@ -1193,8 +1193,13 @@ update_device = function(device, create) local success = true local errtxt -- Validate the settings + local something = false for n,c in pairs(device.value.classes.value) do success = modelfunctions.validateselect(c) and success + if c.value ~= "" then something = true end + end + if not something then + success = false end if success then local res, err = pcall(function() -- cgit v1.2.3