#NEWLINE# def form_valid( self , form ) : #NEWLINE# #INDENT# self . set_customer ( ) #NEWLINE# try : #NEWLINE# #INDENT# self . subscribe ( form . customer , plan = form . cleaned_data [ 'plan' ] , token = self . request . POST . get ( 'stripeToken' ) ) #NEWLINE# return redirect ( 'pinax_stripe_subscription_list' ) #NEWLINE# #UNINDENT# except stripe . StripeError as e : #NEWLINE# #INDENT# return self . render_to_response ( self . get_context_data ( form = form , errors = smart_str ( e ) ) )