#NEWLINE# def clean( self ) : #NEWLINE# #INDENT# if ( ( not previous_votes . review . is_anonymous ) and ( self . review . user == self . user ) ) : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'You cannot vote on your own reviews' ) ) #NEWLINE# #UNINDENT# if ( not self . user . id ) : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'Only signed-in users can vote on reviews' ) ) #NEWLINE# #UNINDENT# previous_votes = self . review . votes . filter ( user = self . user ) #NEWLINE# if ( len ( previous_votes ) > 0 ) : #NEWLINE# #INDENT# raise ValidationError ( _ ( 'You can only vote once on a review' ) )