mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 23:02:19 +00:00
Check for MemberTrackingExtended and pass extra parameters as needed
This commit is contained in:
@@ -131,10 +131,12 @@ def import_corp_members(key_id, character_id):
|
|||||||
|
|
||||||
# grab and decode /corp/MemberTracking.xml.aspx
|
# grab and decode /corp/MemberTracking.xml.aspx
|
||||||
if gargoyle.is_active('eve-cak') and acc.api_keytype == API_KEYTYPE_CORPORATION:
|
if gargoyle.is_active('eve-cak') and acc.api_keytype == API_KEYTYPE_CORPORATION:
|
||||||
if not acc.has_access(11):
|
if not acc.has_access(11) and not acc.has_access(25):
|
||||||
log.error('Key does not have access to MemberTracking', extra={'data': {'key_id': key_id, 'character_id': character_id}})
|
log.error('Key does not have access to MemberTrackingLimited or MemberTrackingExtended', extra={'data': {'key_id': key_id, 'character_id': character_id}})
|
||||||
return
|
return
|
||||||
auth_params = {'keyid': acc.api_user_id, 'vcode': acc.api_key, 'characterID': character_id }
|
auth_params = {'keyid': acc.api_user_id, 'vcode': acc.api_key, 'characterID': character_id }
|
||||||
|
if acc.has_access(25):
|
||||||
|
auth.params['extended'] = 1
|
||||||
else:
|
else:
|
||||||
auth_params = {'userID': acc.api_user_id, 'apiKey': acc.api_key, 'characterID': character_id }
|
auth_params = {'userID': acc.api_user_id, 'apiKey': acc.api_key, 'characterID': character_id }
|
||||||
char_doc = CachedDocument.objects.api_query('/corp/MemberTracking.xml.aspx',
|
char_doc = CachedDocument.objects.api_query('/corp/MemberTracking.xml.aspx',
|
||||||
@@ -156,10 +158,15 @@ def import_corp_members(key_id, character_id):
|
|||||||
if created:
|
if created:
|
||||||
charobj.name = character['name']
|
charobj.name = character['name']
|
||||||
charobj.corporation = corp
|
charobj.corporation = corp
|
||||||
|
charobj.corporation_date = character['startDateTime']
|
||||||
|
if 'logonDateTime' in character:
|
||||||
charobj.last_login = character['logonDateTime']
|
charobj.last_login = character['logonDateTime']
|
||||||
charobj.last_logoff = character['logoffDateTime']
|
charobj.last_logoff = character['logoffDateTime']
|
||||||
charobj.current_location_id = int(character['locationID'])
|
charobj.current_location_id = int(character['locationID'])
|
||||||
charobj.corporation_date = character['startDateTime']
|
else:
|
||||||
|
charobj.last_login = None
|
||||||
|
charobj.last_logoff = None
|
||||||
|
charobj.current_location_id = None
|
||||||
charobj.save()
|
charobj.save()
|
||||||
if created:
|
if created:
|
||||||
import_eve_character.delay(character['characterID'])
|
import_eve_character.delay(character['characterID'])
|
||||||
|
|||||||
Reference in New Issue
Block a user