summaryrefslogtreecommitdiff
path: root/grc/core/base.py
diff options
context:
space:
mode:
authorVolker Schroer <3470424+dl1ksv@users.noreply.github.com>2021-05-17 11:09:32 +0200
committermormj <34754695+mormj@users.noreply.github.com>2021-06-01 09:20:33 -0400
commite562d6b3c82a30f12b4e8e2585447dddeb88e93d (patch)
treefc11e901d912690540f363d2bd13a5bfd593c4c5 /grc/core/base.py
parentd3dc106719fa01f6432b3bafc839dc455f61d695 (diff)
grc: handle variables of type raw correctly
At the moment grc does not validate variables, as they are of type raw. So they are always treated as valid, which leads to some problems, see: #4519. A approach to fix #4519 is #4531. This approach improves the situation, but has still some problems. param.py provides a validator function for dtype raw, but this is not used, as dtypes.py provides no validator function for dtype raw. This fix clears the error messages in base.rewrite not in base.elements.validate, so the error messages are kept. In addition this makes it possible, to make the code in VariableEditor.py smoother. The error messages are kept on switching the different tabs in VariableEditor. Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
Diffstat (limited to 'grc/core/base.py')
-rw-r--r--grc/core/base.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/grc/core/base.py b/grc/core/base.py
index e92c4f923a..8d9a20aa75 100644
--- a/grc/core/base.py
+++ b/grc/core/base.py
@@ -23,8 +23,6 @@ class Element(object):
Validate this element and call validate on all children.
Call this base method before adding error messages in the subclass.
"""
- del self._error_messages[:]
-
for child in self.children():
child.validate()
@@ -77,6 +75,7 @@ class Element(object):
Rewrite this element and call rewrite on all children.
Call this base method before rewriting the element.
"""
+ del self._error_messages[:]
for child in self.children():
child.rewrite()