diff options
author | Josh Morman <jmorman@perspectalabs.com> | 2019-10-07 11:07:12 -0400 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2019-11-01 15:18:16 +0100 |
commit | 204df938200712ae4647d3ef7db62f73e22d1a09 (patch) | |
tree | aed12a1ac0b8b5882c9b7ce76c1037415d86181c | |
parent | 8eb1a354c0b5126b6c0b7d55b68963a155088b3a (diff) |
grc: validate gui hints
committing the fix suggested by @haakov
Make gui_hint collisions show up as validation errors
Fixes #2287
-rw-r--r-- | grc/core/params/dtypes.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/grc/core/params/dtypes.py b/grc/core/params/dtypes.py index 093ca67dc9..94a1a8d671 100644 --- a/grc/core/params/dtypes.py +++ b/grc/core/params/dtypes.py @@ -115,3 +115,10 @@ def validate_vector(param): if not all(isinstance(item, valid_types) for item in param.get_evaluated()): raise ValidateError('Expression {!r} is invalid for type {!r}.'.format( param.get_evaluated(), param.dtype)) + +@validates('gui_hint') +def validate_gui_hint(param): + try: + param.parse_gui_hint(param.value) + except Exception as e: + raise ValidateError(str(e))
\ No newline at end of file |