Permalink
Browse files

Normalize Evernote expiration timestamp.

  • Loading branch information...
1 parent c76cc91 commit 39d7841225b1354dec646202f6acf66b415c4dce @KrzysiekJ KrzysiekJ committed Feb 27, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 social_auth/backends/contrib/evernote.py
@@ -53,6 +53,15 @@ class EvernoteBackend(OAuthBackend):
('edam_expires', 'expires')
]
+ @classmethod
+ def extra_data(cls, user, uid, response, details=None):
+ data = super(EvernoteBackend, cls).extra_data(user, uid, response, details)
+ # Evernote returns expiration timestamp in miliseconds, so it needs to
+ # be normalized.
+ if 'expires' in data:
+ data['expires'] = unicode(int(data['expires']) / 1000)
+ return data
+
def get_user_details(self, response):
"""Return user details from Evernote account"""
return {

0 comments on commit 39d7841

Please sign in to comment.