From da400983f340d47d6ee616f2081747bbc6232b54 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Fri, 2 Apr 2010 20:59:40 +0100 Subject: [PATCH] Eve_api module now pulls Corp if we don't have a record of it, and aborts on a error --- eve_api/api_puller/accounts.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eve_api/api_puller/accounts.py b/eve_api/api_puller/accounts.py index 8f84d12..274bbb7 100755 --- a/eve_api/api_puller/accounts.py +++ b/eve_api/api_puller/accounts.py @@ -59,6 +59,11 @@ def import_eve_account(api_key, user_id): # Get this first, as it's safe. corporation_id = node.getAttribute('corporationID') corp, created = EVEPlayerCorporation.objects.get_or_create(id=corporation_id) + if not corp.name: + try: + corp.query_and_update_corp() + except: + pass # Do this last, since the things we retrieved above are used # on the EVEPlayerCharacter object's fields. character_id = node.getAttribute('characterID')