fixed IS_JSON, thanks Alan
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 2.4.1-alpha.2+timestamp.2013.01.21.14.12.24
|
||||
Version 2.4.1-alpha.2+timestamp.2013.01.21.16.42.00
|
||||
|
||||
+9
-4
@@ -328,12 +328,17 @@ class IS_JSON(Validator):
|
||||
self.error_message = error_message
|
||||
|
||||
def __call__(self, value):
|
||||
if value is None:
|
||||
return None
|
||||
try:
|
||||
simplejson.loads(value)
|
||||
return (value, None)
|
||||
return (simplejson.loads(value), None)
|
||||
except JSONErrors:
|
||||
pass
|
||||
return (value, translate(self.error_message))
|
||||
return (value, translate(self.error_message))
|
||||
|
||||
def formatter(self,value):
|
||||
if value is None:
|
||||
return None
|
||||
return simplejson.dumps(value)
|
||||
|
||||
|
||||
class IS_IN_SET(Validator):
|
||||
|
||||
Reference in New Issue
Block a user