libs/cbi: Simplified _uvl_validate_section
This commit is contained in:
parent
0e05dbb02e
commit
171cbec25d
1 changed files with 7 additions and 10 deletions
|
@ -94,20 +94,17 @@ local function _uvl_validate_section(node, name)
|
||||||
end
|
end
|
||||||
for i, v in ipairs(err.childs) do
|
for i, v in ipairs(err.childs) do
|
||||||
if v.option and node.fields[v.option] then
|
if v.option and node.fields[v.option] then
|
||||||
if v:is(luci.uvl.errors.ERR_OPTION) then
|
if v:is(luci.uvl.errors.ERR_DEPENDENCY) 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
|
node.fields[v.option].tag_reqerror[name] = true
|
||||||
elseif suberr:is(luci.uvl.errors.ERR_OPT_REQUIRED) then
|
elseif v:is(luci.uvl.errors.ERR_OPT_REQUIRED) then
|
||||||
node.fields[v.option].tag_missing[name] = true
|
node.fields[v.option].tag_missing[name] = true
|
||||||
node.tag_deperror[name] = true
|
node.tag_deperror[name] = true
|
||||||
else
|
elseif v:is(luci.uvl.errors.ERR_OPTION) then
|
||||||
node.fields[v.option].tag_invalid[name] = true
|
node.fields[v.option].tag_invalid[name] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue