From b3562a50d5f6e7f77d8786343f439b60474b9e28 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Wed, 5 Jan 2011 07:16:37 +0000 Subject: [PATCH] Form the set after the list has been created --- eve_api/tasks/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eve_api/tasks/account.py b/eve_api/tasks/account.py index d76b909..566a8d3 100644 --- a/eve_api/tasks/account.py +++ b/eve_api/tasks/account.py @@ -109,12 +109,12 @@ def import_apikey_func(api_userid, api_key, user=None, force_cache=False): # Process the account's character list charlist = set(account.characters.all().values_list('id', flat=True)) - newcharlist = set([]) + newcharlist = [] for char in doc['result']['characters']: import_eve_character.delay(char['characterID'], api_key, api_userid, callback=link_char_to_account.subtask(account=account.id)) newcharlist.append(int(char['characterID'])) - toremove = charlist - newcharlist + toremove = charlist - set(newcharlist) for char in account.characters.filter(id__in=toremove): account.characters.remove(char) return account