parameters: (request)
return_statement: return redirect('dashboard')
docstring: After ensured signup,
docstring_summary: After ensured signup,
docstring_tokens: After ensured signup
function: def retrieve_oauth(request):
      '''
      After ensured signup, 
      '''
      code = request.GET.get('code')
      if not code:
          raise Http404
  
      r = requests.post(
          url='https://connect.stripe.com/oauth/token',
          headers={'Accept': 'application/json',
                   'Authorization': 'Bearer {0}'.format(settings.STRIPE_CLIENT_SECRET)},
          data={'grant_type': 'authorization_code',
                'client_id': settings.STRIPE_CLIENT_ID,
                'scope': 'read_only',
                'code': code})
  
      try:
          r.raise_for_status()
      except requests.HTTPError:
          return render(request, 'oauth/failed.html', locals())
  
      profile = request.user.get_profile()
      profile.set(r.json)
      profile.save()
  
      # build the cache in the background...
      profile.rebuild()
      messages.success(request, 'Data refreshing... refresh in about a minute.')
  
      return redirect('dashboard')
function_tokens: def retrieve_oauth ( request ) : code = request . GET . get ( 'code' ) if not code : raise Http404 r = requests . post ( url = 'https://connect.stripe.com/oauth/token' , headers = { 'Accept' : 'application/json' , 'Authorization' : 'Bearer {0}' . format ( settings . STRIPE_CLIENT_SECRET ) } , data = { 'grant_type' : 'authorization_code' , 'client_id' : settings . STRIPE_CLIENT_ID , 'scope' : 'read_only' , 'code' : code } ) try : r . raise_for_status ( ) except requests . HTTPError : return render ( request , 'oauth/failed.html' , locals ( ) ) profile = request . user . get_profile ( ) profile . set ( r . json ) profile . save ( ) # build the cache in the background... profile . rebuild ( ) messages . success ( request , 'Data refreshing... refresh in about a minute.' ) return redirect ( 'dashboard' )