From a96d4b4dc949941014b6eec52501572489b9cfc9 Mon Sep 17 00:00:00 2001 From: jbernardis Date: Wed, 6 May 2015 19:37:51 -0400 Subject: [PATCH] addsensordlg.py: always validate not required fields. Previously funny things could happen, like a refusal to save temperature sensors just because some unused field contained garbage. --- configtool/addsensordlg.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configtool/addsensordlg.py b/configtool/addsensordlg.py index f68c369..544ec87 100644 --- a/configtool/addsensordlg.py +++ b/configtool/addsensordlg.py @@ -346,6 +346,8 @@ class AddSensorDlg(wx.Dialog): self.bSave.Enable(False) def onTextCtrlInteger(self, tc, rqd): + if not rqd: + return True w = tc.GetValue().strip() if w == "": if rqd: @@ -368,6 +370,8 @@ class AddSensorDlg(wx.Dialog): return valid def onTextCtrlFloat(self, tc, rqd): + if not rqd: + return True w = tc.GetValue().strip() if w == "": if rqd: