mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 20:40:17 +02:00
Merge branch 'affiliations' into 'master'
Affiliations for Character updates See merge request allianceauth/allianceauth!1140
This commit is contained in:
commit
4d435d58c5
@ -12,6 +12,7 @@ get_alliances_alliance_id_corporations
|
|||||||
get_corporations_corporation_id
|
get_corporations_corporation_id
|
||||||
get_characters_character_id
|
get_characters_character_id
|
||||||
get_universe_types_type_id
|
get_universe_types_type_id
|
||||||
|
post_character_affiliation
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@ -189,11 +190,13 @@ class EveSwaggerProvider(EveProvider):
|
|||||||
def get_character(self, character_id):
|
def get_character(self, character_id):
|
||||||
try:
|
try:
|
||||||
data = self.client.Character.get_characters_character_id(character_id=character_id).result()
|
data = self.client.Character.get_characters_character_id(character_id=character_id).result()
|
||||||
|
affiliation = self.client.Character.post_characters_affiliation(characters=[character_id]).result()[0]
|
||||||
|
|
||||||
model = Character(
|
model = Character(
|
||||||
id=character_id,
|
id=character_id,
|
||||||
name=data['name'],
|
name=data['name'],
|
||||||
corp_id=data['corporation_id'],
|
corp_id=affiliation['corporation_id'],
|
||||||
alliance_id=data['alliance_id'] if 'alliance_id' in data else None,
|
alliance_id=affiliation['alliance_id'] if 'alliance_id' in affiliation else None,
|
||||||
)
|
)
|
||||||
return model
|
return model
|
||||||
except (HTTPNotFound, HTTPUnprocessableEntity):
|
except (HTTPNotFound, HTTPUnprocessableEntity):
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user