From f3caf2a5702e3bc55aa645029e1ff3e58c7ff42f Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sun, 30 May 2010 22:39:24 +0100 Subject: [PATCH] Move stripping to above URL generation, otherwise we duplicate on the cache --- eve_proxy/models.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/eve_proxy/models.py b/eve_proxy/models.py index 68ef7c5..8fc4c66 100755 --- a/eve_proxy/models.py +++ b/eve_proxy/models.py @@ -61,6 +61,16 @@ class CachedDocumentManager(models.Manager): 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) if params == None or paramstr.strip() == '': @@ -84,16 +94,6 @@ class CachedDocumentManager(models.Manager): # EVE uses UTC. 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 # the local cache (based on cached_until). if no_cache or created or \