def decorated_view(*args, **kwargs): if not users.get_current_user(): return redirect(users.create_login_url(request.url)) credentials = call._get_creds(users.get_current_user().user_id()) if not credentials: return redirect('/signup') return func(*args, **kwargs)
def test_userinfo(): user = users.get_current_user() credentials = call._get_creds(user.user_id()) user_info_service = build( serviceName='oauth2', version='v2', http=credentials.authorize(httplib2.Http())) user_info = None try: user_info = user_info_service.userinfo().get().execute() except errors.HttpError, e: logging.error('An error occurred: %s', e)