mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Form the set after the list has been created
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user