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,20 +155,23 @@ def import_eve_character_func(character_id, key_id=None, logger=logging.getLogge
|
|||||||
charskillobj.save()
|
charskillobj.save()
|
||||||
pchar.total_sp = pchar.total_sp + int(skill['skillpoints'])
|
pchar.total_sp = pchar.total_sp + int(skill['skillpoints'])
|
||||||
|
|
||||||
try:
|
if not acc.is_cak or acc.has_access(18):
|
||||||
skillqueue = CachedDocument.objects.api_query('/char/SkillInTraining.xml.aspx', params=auth_params, no_cache=False)
|
try:
|
||||||
except DocumentRetrievalError, exc:
|
skillqueue = CachedDocument.objects.api_query('/char/SkillInTraining.xml.aspx', params=auth_params, no_cache=False)
|
||||||
logger.error('Error retrieving SkillInTraining.xml.aspx for User ID %s, Character ID %s - %s' % (user_id, character_id, exc))
|
except DocumentRetrievalError, 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']:
|
||||||
|
queuedoc = queuedoc['eveapi']['result']
|
||||||
|
EVEPlayerCharacterSkill.objects.filter(character=pchar).update(in_training=0)
|
||||||
|
if int(queuedoc['skillInTraining']):
|
||||||
|
skillobj, created = EVESkill.objects.get_or_create(pk=queuedoc['trainingTypeID'])
|
||||||
|
charskillobj, created = EVEPlayerCharacterSkill.objects.get_or_create(skill=skillobj, character=pchar)
|
||||||
|
charskillobj.in_training = queuedoc['trainingToLevel']
|
||||||
|
charskillobj.save()
|
||||||
else:
|
else:
|
||||||
queuedoc = basic_xml_parse_doc(skillqueue)
|
EVEPlayerCharacterSkill.objects.filter(character=pchar).update(in_training=0)
|
||||||
if not 'error' in queuedoc['eveapi'] and 'result' in queuedoc['eveapi']:
|
|
||||||
queuedoc = queuedoc['eveapi']['result']
|
|
||||||
EVEPlayerCharacterSkill.objects.filter(character=pchar).update(in_training=0)
|
|
||||||
if int(queuedoc['skillInTraining']):
|
|
||||||
skillobj, created = EVESkill.objects.get_or_create(pk=queuedoc['trainingTypeID'])
|
|
||||||
charskillobj, created = EVEPlayerCharacterSkill.objects.get_or_create(skill=skillobj, character=pchar)
|
|
||||||
charskillobj.in_training = queuedoc['trainingToLevel']
|
|
||||||
charskillobj.save()
|
|
||||||
|
|
||||||
# Process the character's roles
|
# Process the character's roles
|
||||||
pchar.roles.clear()
|
pchar.roles.clear()
|
||||||
|
|||||||
Reference in New Issue
Block a user