Permalink
Browse files

logging on graph expiration

  • Loading branch information...
1 parent 3bb46d6 commit 928dbd2888bfb00b2fcf862c194f964a5f889f86 @tschellenbach committed Feb 22, 2012
Showing with 9 additions and 6 deletions.
  1. +1 −1 django_facebook/__init__.py
  2. +8 −5 django_facebook/connect.py
@@ -4,7 +4,7 @@
__license__ = 'BSD'
-__version__ = '3.5.3'
+__version__ = '3.5.4'
__maintainer__ = 'Thierry Schellenbach'
__email__ = 'thierryschellenbach@gmail.com'
__status__ = 'Production'
View
@@ -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

0 comments on commit 928dbd2

Please sign in to comment.