Show More
@@ -28,6 +28,7 b' import colander' | |||
|
28 | 28 | |
|
29 | 29 | from rhodecode.translation import _ |
|
30 | 30 | from rhodecode.lib.utils2 import glob2re, safe_unicode |
|
31 | from rhodecode.lib.ext_json import json | |
|
31 | 32 | |
|
32 | 33 | log = logging.getLogger(__name__) |
|
33 | 34 | |
@@ -138,3 +139,11 b' class CloneUriValidator(object):' | |||
|
138 | 139 | msg = _(u'invalid clone url for {repo_type} repository').format( |
|
139 | 140 | repo_type=self.repo_type) |
|
140 | 141 | raise colander.Invalid(node, msg) |
|
142 | ||
|
143 | ||
|
144 | def json_validator(node, value): | |
|
145 | try: | |
|
146 | json.loads(value) | |
|
147 | except (Exception,): | |
|
148 | msg = _(u'Please enter a valid json object') | |
|
149 | raise colander.Invalid(node, msg) |
General Comments 0
You need to be logged in to leave comments.
Login now