Fixed API key updating, removed the ability for people to remove API keys

This commit is contained in:
2011-07-07 19:37:11 +01:00
parent 4ff890077f
commit 08fe37fe4b
5 changed files with 26 additions and 13 deletions

View File

@@ -102,8 +102,10 @@ def import_apikey_func(api_userid, api_key, user=None, force_cache=False, log=lo
# Create or retrieve the account last to make sure everything
# before here is good to go.
account, created = EVEAccount.objects.get_or_create(api_key=api_key, api_user_id=api_userid)
account.api_key = api_key
account, created = EVEAccount.objects.get_or_create(api_user_id=api_userid)
if not created and not account.api_key == api_key:
account.api_key = api_key
account.api_keytype = API_KEYTYPE_UNKNOWN
account.api_status = API_STATUS_OK
if user and created:
account.user = User.objects.get(id=user)