mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Fix error on log, also make the queue only execute if we have access to it
This commit is contained in:
@@ -155,10 +155,11 @@ def import_eve_character_func(character_id, key_id=None, logger=logging.getLogge
|
||||
charskillobj.save()
|
||||
pchar.total_sp = pchar.total_sp + int(skill['skillpoints'])
|
||||
|
||||
if not acc.is_cak or acc.has_access(18):
|
||||
try:
|
||||
skillqueue = CachedDocument.objects.api_query('/char/SkillInTraining.xml.aspx', params=auth_params, no_cache=False)
|
||||
except DocumentRetrievalError, exc:
|
||||
logger.error('Error retrieving SkillInTraining.xml.aspx for User ID %s, Character ID %s - %s' % (user_id, character_id, exc))
|
||||
logger.error('Error retrieving SkillInTraining.xml.aspx for User ID %s, Character ID %s - %s' % (key_id, character_id, exc))
|
||||
else:
|
||||
queuedoc = basic_xml_parse_doc(skillqueue)
|
||||
if not 'error' in queuedoc['eveapi'] and 'result' in queuedoc['eveapi']:
|
||||
@@ -169,6 +170,8 @@ def import_eve_character_func(character_id, key_id=None, logger=logging.getLogge
|
||||
charskillobj, created = EVEPlayerCharacterSkill.objects.get_or_create(skill=skillobj, character=pchar)
|
||||
charskillobj.in_training = queuedoc['trainingToLevel']
|
||||
charskillobj.save()
|
||||
else:
|
||||
EVEPlayerCharacterSkill.objects.filter(character=pchar).update(in_training=0)
|
||||
|
||||
# Process the character's roles
|
||||
pchar.roles.clear()
|
||||
|
||||
Reference in New Issue
Block a user