Move stripping to above URL generation, otherwise we duplicate on the cache

This commit is contained in:
2010-05-30 22:39:24 +01:00
parent 661b93cc56
commit f3caf2a570

View File

@@ -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 \