#NEWLINE# def clean( self , data , initial = None ) : #NEWLINE# #INDENT# if ( ( initial is None ) or ( initial == '' ) ) : #NEWLINE# #INDENT# raise Exception ( "ReCaptchaField requires the client's IP be set to the initial value" ) #NEWLINE# #UNINDENT# ip = initial #NEWLINE# resp = captcha . submit ( data . get ( 'recaptcha_challenge_field' , None ) , data . get ( 'recaptcha_response_field' , None ) , dndproject . settings . RECAPTCHA_PRIVATE , ip ) #NEWLINE# if ( not resp . is_valid ) : #NEWLINE# #INDENT# raise forms . ValidationError ( self . default_error_messages . get ( resp . error_code , ( 'Unknown error: %s' % resp . error_code ) ) )