Пример #1
0
 def context(self):
   service = oauth_helper.createDocsService(self.data)
   next = '%s?next=%s' % (self.redirect.urlOf('gdata_oauth_verify'),
                          self.request.GET.get('next','/'))
   url = oauth_helper.generateOAuthRedirectURL(
       service, self.data.user,
       next)
   context = {
       'approval_page_url': url,
       'page_name': 'Authorization Required',
   }
   return context
Пример #2
0
 def get(self):
   access_token = oauth_helper.getAccessToken(self.data.user)
   if access_token:
     url = self.redirect.urlOf('gdata_popup_oauth_verified')
   else:
     service = oauth_helper.createDocsService(self.data)
     next = '%s?next=%s' % (self.redirect.urlOf('gdata_oauth_verify'),
                            self.redirect.urlOf('gdata_popup_oauth_verified'))
     url = oauth_helper.generateOAuthRedirectURL(
         service, self.data.user,
         next)
   self.redirect.toUrl(url)
   return self.response