Skip to content

Commit

Permalink
logging on graph expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
tschellenbach committed Feb 22, 2012
1 parent 3bb46d6 commit 928dbd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion django_facebook/__init__.py
Expand Up @@ -4,7 +4,7 @@


__license__ = 'BSD'
__version__ = '3.5.3'
__version__ = '3.5.4'
__maintainer__ = 'Thierry Schellenbach'
__email__ = 'thierryschellenbach@gmail.com'
__status__ = 'Production'
Expand Down
13 changes: 8 additions & 5 deletions django_facebook/connect.py
Expand Up @@ -98,11 +98,14 @@ def connect_user(request, access_token=None, facebook_graph=None):
#store the access token for later usage if the profile model supports it
if hasattr(profile, 'access_token'):
# only update the access token if it is long lived and
# not equal to the current token
if not graph.expires and graph.access_token != profile.access_token:
# TODO, maybe we should just always do this.
profile.access_token = graph.access_token
profile.save()
if graph.expires:
logger.warn('we shouldnt be finding a graph expiration, its set to %s', graph.expires)
#TODO: maybe we should still save these
else:
# and not equal to the current token
if graph.access_token != profile.access_token:
profile.access_token = graph.access_token
profile.save()

return action, user

Expand Down

0 comments on commit 928dbd2

Please sign in to comment.