#NEWLINE# def validate_json( form , field ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# json . loads ( field . data ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# logging . exception ( e ) #NEWLINE# raise ValidationError ( "json isn't valid" )