#NEWLINE# def form_valid( self , form ) : #NEWLINE# #INDENT# 'Handles a valid form response.' #NEWLINE# if self . request . user . can_impersonate ( ) : #NEWLINE# #INDENT# session = self . request . session #NEWLINE# session [ 'impersonate_id' ] = form . cleaned_data [ 'user_to_become' ] . pk #NEWLINE# session . save ( ) #NEWLINE# #UNINDENT# return HttpResponseRedirect ( self . get_success_url ( ) )