#NEWLINE# def form_valid( self , form ) : #NEWLINE# #INDENT# if ( form . is_guest_checkout ( ) or form . is_new_account_checkout ( ) ) : #NEWLINE# #INDENT# email = form . cleaned_data [ 'username' ] #NEWLINE# self . checkout_session . set_guest_email ( email ) #NEWLINE# signals . start_checkout . send_robust ( sender = self , request = self . request , email = email ) #NEWLINE# if form . is_new_account_checkout ( ) : #NEWLINE# #INDENT# messages . info ( self . request , _ ( 'Create your account and then you will be redirected back to the checkout process' ) ) #NEWLINE# self . success_url = ( '%s?next=%s&email=%s' % ( reverse ( 'customer:register' ) , reverse ( 'checkout:shipping-address' ) , urlquote ( self ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# user = form . get_user ( ) #NEWLINE# login ( self . request , user ) #NEWLINE# signals . start_checkout . send_robust ( sender = self , request = self . request ) #NEWLINE# #UNINDENT# return redirect ( self . get_success_url ( ) )