Flake8
This commit is contained in:
committed by
Sébastien Corbin
parent
63c3d7d2dc
commit
382c824cca
@@ -18,13 +18,13 @@ class JSignatureField(Field):
|
||||
widget = JSignatureWidget()
|
||||
|
||||
def to_python(self, value):
|
||||
"""
|
||||
Validates that the input can be red as a JSON object.
|
||||
Returns a Python list (JSON object unserialized).
|
||||
"""
|
||||
if value in JSIGNATURE_EMPTY_VALUES:
|
||||
return None
|
||||
try:
|
||||
return json.loads(value)
|
||||
except ValueError:
|
||||
raise ValidationError('Invalid JSON format.')
|
||||
"""
|
||||
Validates that the input can be red as a JSON object.
|
||||
Returns a Python list (JSON object unserialized).
|
||||
"""
|
||||
if value in JSIGNATURE_EMPTY_VALUES:
|
||||
return None
|
||||
try:
|
||||
return json.loads(value)
|
||||
except ValueError:
|
||||
raise ValidationError('Invalid JSON format.')
|
||||
|
||||
Reference in New Issue
Block a user