From 64336829cf37ec2e17433f2d2963d000004eef09 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sun, 15 Mar 2026 19:57:38 +0100 Subject: [PATCH] [FIX] Various little things in `eveonline.providers` ### Fixed - `__init__(self)` instead of `__init__(cls)` - AttributeError: 'EveOpenAPIProvider' object has no attribute '_faction_list' - Return typehint for `get_alliance_corps` - `use_cache` parameter for `get_all_factions` was not defined but used in `get_faction` --- allianceauth/eveonline/providers.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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