diff --git a/eve_api/api_puller/accounts.py b/eve_api/api_puller/accounts.py index 277dfc0..4b5d0f6 100755 --- a/eve_api/api_puller/accounts.py +++ b/eve_api/api_puller/accounts.py @@ -72,14 +72,11 @@ def import_eve_account(api_key, user_id, force_cache=False): # Create or retrieve the account last to make sure everything # before here is good to go. - try: - account = EVEAccount.objects.get(id=user_id) - except EVEAccount.DoesNotExist: - account = EVEAccount(id=user_id) - + account, created = EVEAccount.objects.get_or_create(id=user_id) account.api_key = api_key account.api_user_id = user_id account.api_status = API_STATUS_OK + account.save() for node in characters_node_children: try: