def failed_validation(*messages):
 m = []
 for msg in messages:
  m.append({'type': 'error', 'message': msg, 'tier': 1})
 return json.dumps({'errors': 1, 'success': False, 'messages': m})

def failed_validation ( * messages ) : m = [ ] for msg in messages : m . append ( { 'type' : 'error' , 'message' : msg , 'tier' : 1 } ) return json . dumps ( { 'errors' : 1 , 'success' : False , 'messages' : m } )
return a validation object that looks like the add-on validator .