Form the set after the list has been created

This commit is contained in:
2011-01-05 07:16:37 +00:00
parent f3feeaf4b3
commit b3562a50d5

View File

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