From 41d7a731e47ef023e689bc6b5ebc694761ce3b3d Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Fri, 4 Jun 2010 08:43:01 +0100 Subject: [PATCH] Refresh API now flushes the cache as well --- eve_api/api_puller/accounts.py | 4 ++-- sso/views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eve_api/api_puller/accounts.py b/eve_api/api_puller/accounts.py index de755ee..76a64b6 100755 --- a/eve_api/api_puller/accounts.py +++ b/eve_api/api_puller/accounts.py @@ -18,7 +18,7 @@ from eve_api.app_defines import * from eve_api.api_exceptions import APIAuthException, APINoUserIDException from eve_api.models import EVEAccount, EVEPlayerCharacter, EVEPlayerCorporation -def import_eve_account(api_key, user_id): +def import_eve_account(api_key, user_id, force_cache=False): """ Imports an account from the API into the EVEAccount model. """ @@ -27,7 +27,7 @@ def import_eve_account(api_key, user_id): try: account_doc = CachedDocument.objects.api_query('/account/Characters.xml.aspx', params=auth_params, - no_cache=False) + no_cache=force_cache) except APIAuthException: try: account = EVEAccount.objects.get(id=user_id) diff --git a/sso/views.py b/sso/views.py index 83dd8eb..551b7a7 100644 --- a/sso/views.py +++ b/sso/views.py @@ -128,7 +128,7 @@ def eveapi_refresh(request, userid=0): except EVEAccount.DoesNotExist: pass else: - import_eve_account(acc.api_key, acc.api_user_id) + import_eve_account(acc.api_key, acc.api_user_id, force_cache=True) request.user.get_profile().update_access() request.user.message_set.create(message="Key %s has been refreshed from the EVE API." % acc.api_user_id)