~michael.nelson/ubuntu-webcatalog/1267731-import-sca-apps-error

« back to all changes in this revision

Viewing changes to src/webcatalog/auth.py

  • Committer: Tarmac
  • Author(s): Łukasz Czyżykowski
  • Date: 2013-04-16 13:40:21 UTC
  • mfrom: (178.1.21 upgrade-to-django-1.5)
  • Revision ID: tarmac-20130416134021-q45ptpwb4bn0payb
[r=michael.nelson] Upgrade to Django 1.5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
__all__ = [
25
25
    'SSOOAuthAuthentication',
26
26
]
 
27
import pytz
27
28
 
28
29
from datetime import datetime, timedelta
29
30
from django.conf import settings
100
101
        tokens = Token.objects.filter(token=oauthtoken,
101
102
                                      consumer__key=consumer_key)
102
103
        if (len(tokens) == 0 or
103
 
                tokens[0].updated_at < datetime.now() - TOKEN_CACHE_EXPIRY):
 
104
                tokens[0].updated_at < (
 
105
                datetime.now(pytz.utc) - TOKEN_CACHE_EXPIRY)):
104
106
            pieces = web_services.get_data_for_account(
105
107
                token=oauthtoken, openid_identifier=consumer_key,
106
108
                signature=request.get_parameter('oauth_signature'))