Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Normalize Evernote expiration timestamp #619

Merged
merged 1 commit into from

2 participants

@KrzysiekJ

Evernote returns expiration timestamp in miliseconds, so it needs to be divided by 1000 before saving.

@omab omab merged commit adc462d into from
@omab
Owner

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 27, 2013
  1. @KrzysiekJ
This page is out of date. Refresh to see the latest.
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 {
Something went wrong with that request. Please try again.