mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Move stripping to above URL generation, otherwise we duplicate on the cache
This commit is contained in:
@@ -61,6 +61,16 @@ class CachedDocumentManager(models.Manager):
|
|||||||
the query: userID=1&characterID=xxxxxxxx
|
the query: userID=1&characterID=xxxxxxxx
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# If we have a service ID, store and strip it from the query string.
|
||||||
|
if 'service' in params:
|
||||||
|
service = params['service']
|
||||||
|
del params['service']
|
||||||
|
else:
|
||||||
|
service = 'auth'
|
||||||
|
|
||||||
|
if 'userID' in params:
|
||||||
|
userid = params['userID']
|
||||||
|
|
||||||
paramstr = urllib.urlencode(params)
|
paramstr = urllib.urlencode(params)
|
||||||
|
|
||||||
if params == None or paramstr.strip() == '':
|
if params == None or paramstr.strip() == '':
|
||||||
@@ -84,16 +94,6 @@ class CachedDocumentManager(models.Manager):
|
|||||||
# EVE uses UTC.
|
# EVE uses UTC.
|
||||||
current_eve_time = datetime.utcnow()
|
current_eve_time = datetime.utcnow()
|
||||||
|
|
||||||
# If we have a service ID, store and strip it from the query string.
|
|
||||||
if 'service' in params:
|
|
||||||
service = params['service']
|
|
||||||
del params['service']
|
|
||||||
else:
|
|
||||||
service = 'auth'
|
|
||||||
|
|
||||||
if 'userID' in params:
|
|
||||||
userid = params['userID']
|
|
||||||
|
|
||||||
# Figure out if we need hit EVE API and re-cache, or just pull from
|
# Figure out if we need hit EVE API and re-cache, or just pull from
|
||||||
# the local cache (based on cached_until).
|
# the local cache (based on cached_until).
|
||||||
if no_cache or created or \
|
if no_cache or created or \
|
||||||
|
|||||||
Reference in New Issue
Block a user