#NEWLINE# def form_valid( self , form ) : #NEWLINE# #INDENT# if ( ( not perms . may_vote_in_topic ( self . request . user , self . object ) ) or ( not pybb_topic_poll_not_voted ( self . object , self . request . user ) ) ) : #NEWLINE# #INDENT# return HttpResponseForbidden ( ) #NEWLINE# #UNINDENT# answers = form . cleaned_data [ 'answers' ] #NEWLINE# for answer in answers : #NEWLINE# #INDENT# if ( answer . topic != self . object ) : #NEWLINE# #INDENT# return HttpResponseBadRequest ( ) #NEWLINE# #UNINDENT# PollAnswerUser . objects . create ( poll_answer = answer , user = self . request . user ) #NEWLINE# #UNINDENT# return super ( ModelFormMixin , self ) . form_valid ( form )