Permalink
Browse files

Add 'approval_prompt': 'force' to decorator, in order to get a refres…

…h token
  • Loading branch information...
ronjouch committed Jun 10, 2013
1 parent f78a194 commit 0a8d2b5cce38dde487fddd6c609abe576f0cc977
Showing with 4 additions and 1 deletion.
  1. +1 −1 dailygrooves/cron.yaml
  2. +3 −0 dailygrooves/dailygrooves.py
View
@@ -1,5 +1,5 @@
cron:
- description: daily fetch
url: /cronfetch
- schedule: every day 08:25
+ schedule: every day 18:06
timezone: US/Eastern
@@ -52,6 +52,9 @@ class FetchHandler(RequestHandler):
@DECORATOR.oauth_required
def get(self):
+ # approval_prompt=force required to force getting a refresh_token
+ # that will be used in cron in offline mode
+ DECORATOR.flow.params.update({'approval_prompt': 'force'})
user_id = users.get_current_user().user_id()
gae_user = GaeUser(id=user_id, date=datetime.now())
gae_user.put()

0 comments on commit 0a8d2b5

Please sign in to comment.