#NEWLINE# def can_user_vote( self , user ) : #NEWLINE# #INDENT# '\n        Test whether the passed user is allowed to vote on this\n        review\n        ' #NEWLINE# if ( not user . is_authenticated ( ) ) : #NEWLINE# #INDENT# return ( False , _ ( 'Only signed in users can vote' ) ) #NEWLINE# #UNINDENT# vote = self . votes . model ( review = self , user = user , delta = 1 ) #NEWLINE# try : #NEWLINE# #INDENT# vote . full_clean ( ) #NEWLINE# #UNINDENT# except ValidationError as e : #NEWLINE# #INDENT# return ( False , ( '%s' % e ) ) #NEWLINE# #UNINDENT# return ( True , '' )