diff options
author | Steven Barth <steven@midlink.org> | 2008-08-30 15:41:02 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-08-30 15:41:02 +0000 |
commit | 171cbec25d279c3913e781c49f3061edc51c15c1 (patch) | |
tree | edee77a7503fd236ec4ca468ea2b1a16545cedb7 /libs | |
parent | 0e05dbb02e68a247f86149cf573b37404882e037 (diff) |
libs/cbi: Simplified _uvl_validate_section
Diffstat (limited to 'libs')
-rw-r--r-- | libs/cbi/luasrc/cbi.lua | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index 6ffeca6b0..fe207739f 100644 --- a/libs/cbi/luasrc/cbi.lua +++ b/libs/cbi/luasrc/cbi.lua @@ -94,16 +94,13 @@ local function _uvl_validate_section(node, name) end for i, v in ipairs(err.childs) do if v.option and node.fields[v.option] then - if v:is(luci.uvl.errors.ERR_OPTION) then - local suberr = v.childs and v.childs[1] - if suberr:is(luci.uvl.errors.ERR_DEPENDENCY) then - node.fields[v.option].tag_reqerror[name] = true - elseif suberr:is(luci.uvl.errors.ERR_OPT_REQUIRED) then - node.fields[v.option].tag_missing[name] = true - node.tag_deperror[name] = true - else - node.fields[v.option].tag_invalid[name] = true - end + if v:is(luci.uvl.errors.ERR_DEPENDENCY) then + node.fields[v.option].tag_reqerror[name] = true + elseif v:is(luci.uvl.errors.ERR_OPT_REQUIRED) then + node.fields[v.option].tag_missing[name] = true + node.tag_deperror[name] = true + elseif v:is(luci.uvl.errors.ERR_OPTION) then + node.fields[v.option].tag_invalid[name] = true end end end |