#NEWLINE# def clean( self , value ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# solution = md5 . new ( value . lower ( ) ) . hexdigest ( ) #NEWLINE# min_datetime = ( datetime . now ( ) - timedelta ( seconds = 300 ) ) #NEWLINE# captcha = Captcha . objects . get ( solution = solution , date_generated__gte = min_datetime ) #NEWLINE# captcha . delete ( ) #NEWLINE# return True #NEWLINE# #UNINDENT# except Captcha . DoesNotExist : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'Wrong code!' ) )