Skip to content
Snippets Groups Projects
Commit 59a28c67 authored by Nils Schneider's avatar Nils Schneider
Browse files

gluon-config-mode: allow contact field to be empty

parent db11e29d
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,7 @@ einsehbar sein wird.]])
o = s:option(Value, "_contact", "Kontakt")
o.default = uci:get_first("gluon-node-info", "owner", "contact", "")
o.rmempty = false
o.rmempty = true
o.datatype = "string"
o.description = "z.B. E-Mail oder Telefonnummer"
o.maxlen = 140
......@@ -122,7 +122,11 @@ function f.handle(self, state, data)
uci:set("gluon-node-info", sname, "latitude", data._latitude)
uci:set("gluon-node-info", sname, "longitude", data._longitude)
end
uci:set("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact", data._contact)
if data._contact ~= nil then
uci:set("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact", data._contact)
else
uci:set("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact")
end
uci:save("gluon-node-info")
uci:commit("gluon-node-info")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment