diff --git a/allianceauth/eveonline/providers.py b/allianceauth/eveonline/providers.py index ee662690..6c28ed06 100644 --- a/allianceauth/eveonline/providers.py +++ b/allianceauth/eveonline/providers.py @@ -143,7 +143,7 @@ class EveOpenAPIProvider(ESIClientProvider): # most operations used here have `use_cache = False` this is cause we don't # want to use the space in ram for mostly useless data. We are using etags tho. - def __init__(cls): + def __init__(self): super().__init__( __esi_compatibility_date__, __title_useragent__, @@ -151,8 +151,9 @@ class EveOpenAPIProvider(ESIClientProvider): __url__, operations=OPEN_API_OPERATIONS ) + self._faction_list = None - def get_alliance_corps(self, alliance_id: int, force_refresh=False) -> Alliance: + def get_alliance_corps(self, alliance_id: int, force_refresh=False) -> list: """Fetch alliance from ESI.""" try: corps = self.client.Alliance.GetAlliancesAllianceIdCorporations( @@ -254,13 +255,13 @@ class EveOpenAPIProvider(ESIClientProvider): raise ObjectNotFound(character_id, 'character') return character.name - def get_all_factions(self, force_refresh=False): + def get_all_factions(self, force_refresh=False, use_cache=True) -> list: """Fetch all factions from ESI.""" if not self._faction_list: self._faction_list = self.client.Universe.GetUniverseFactions( ).result( force_refresh=force_refresh, - use_cache=False + use_cache=use_cache ) return self._faction_list