From f0ea081638b9724d3a592c190d0b190e22acf501 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Fri, 2 Sep 2011 14:23:27 +0100 Subject: [PATCH] Try and ignore people updating with invalid keys --- app/eve_api/tasks/account.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/eve_api/tasks/account.py b/app/eve_api/tasks/account.py index dfee8dd..88a3437 100644 --- a/app/eve_api/tasks/account.py +++ b/app/eve_api/tasks/account.py @@ -133,6 +133,10 @@ def import_apikey_func(api_userid, api_key, user=None, force_cache=False, log=lo if not account: return + if not account.api_key == api_key: + # Attempted change of key failed, ignore + return + error = doc['error']['code'] if int(error) >= 500: # API disabled, down or rejecting, return without changes @@ -187,6 +191,10 @@ def import_apikey_func(api_userid, api_key, user=None, force_cache=False, log=lo if not account: return + if not account.api_key == api_key: + # Attempted change of key failed, ignore + return + error = doc['error']['code'] if int(error) >= 500: # API disabled, down or rejecting, return without changes