Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Normalize Evernote expiration timestamp.

  • Loading branch information...
commit 39d7841225b1354dec646202f6acf66b415c4dce 1 parent c76cc91
@KrzysiekJ KrzysiekJ authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 social_auth/backends/contrib/evernote.py
View
9 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 {
Please sign in to comment.
Something went wrong with that request. Please try again.