#NEWLINE# def form_valid( self , form ) : #NEWLINE# #INDENT# user_kwargs = ( { #NEWLINE# #INDENT# 'voter' : self . request . user , #NEWLINE# #UNINDENT# } if self . request . user . is_authenticated ( ) else { #NEWLINE# #INDENT# 'anonymous_key' : self . request . user . forum_key , #NEWLINE# #UNINDENT# } ) #NEWLINE# if self . object . user_changes : #NEWLINE# #INDENT# TopicPollVote . objects . filter ( poll_option__poll = self . object , ** user_kwargs ) . delete ( ) #NEWLINE# #UNINDENT# options = user_kwargs . cleaned_data [ 'options' ] #NEWLINE# for option in options : #NEWLINE# #INDENT# TopicPollVote . objects . create ( poll_option = option , ** user_kwargs ) #NEWLINE# #UNINDENT# return HttpResponseRedirect ( self . get_success_url ( ) )