luci-app-nlbwon: fix parsing relative interval values from config
authorJo-Philipp Wich <jo@mein.io>
Wed, 13 Nov 2019 16:08:58 +0000 (17:08 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 13 Nov 2019 16:10:21 +0000 (17:10 +0100)
Fixes: #3302
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2e8aa301aa2a1aa07438de8dd962c21f0c8559f2)

applications/luci-app-nlbwmon/luasrc/model/cbi/nlbw/config.lua

index 71e096c61731da97a8e6f494ec629a0fdffde346..08df5b332e7dde8e9f558491c02f03fcfe9c9548 100644 (file)
@@ -72,8 +72,8 @@ interval:depends("_period", "relative")
 interval.write = period.write
 
 interval.cfgvalue = function(self, cfg)
-       local val = m:get(cfg, "database_interval")
-       return val and tonumber(val)
+       local val = tonumber(m:get(cfg, "database_interval"))
+       return val and tostring(val)
 end