From 4f51439167c39a98f674c36943fa5369b2b9a76e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 8 Aug 2017 04:11:54 +0200 Subject: [PATCH] gluon-config-mode-contact-info: remove uci:set() nil check simple-uci will now delete an option when nil is passed. --- .../lib/gluon/config-mode/wizard/0500-contact-info.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua b/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua index 1ef5deaf..300c46fa 100644 --- a/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua +++ b/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua @@ -16,11 +16,7 @@ return function(form, uci) -- without a minimal length, an empty string will be accepted even with "optional = false" o.datatype = "minlength(1)" function o:write(data) - if data then - uci:set("gluon-node-info", owner, "contact", data) - else - uci:delete("gluon-node-info", owner, "contact") - end + uci:set("gluon-node-info", owner, "contact", data) end return {'gluon-node-info'}