#NEWLINE# def validate( self , value ) : #NEWLINE# #INDENT# '\n        Ensure that the SQL passes the blacklist and executes. Execution check is skipped if params are present.\n\n        :param value: The SQL for this Query model.\n        ' #NEWLINE# query = Query ( sql = value ) #NEWLINE# ( passes_blacklist , failing_words ) = query . passes_blacklist ( ) #NEWLINE# error = ( ( MSG_FAILED_BLACKLIST % ', ' . join ( failing_words ) ) if ( not passes_blacklist ) else None ) #NEWLINE# if ( ( not error ) and ( not query . available_params ( ) ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# query . execute_query_only ( ) #NEWLINE# #UNINDENT# except DatabaseError as e : #NEWLINE# #INDENT# error = str ( e ) #NEWLINE# #UNINDENT# #UNINDENT# if error : #NEWLINE# #INDENT# raise ValidationError ( _ ( error ) , code = 'InvalidSql' )