mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-08 19:32:15 +03:00
CAPIData: Only call self.check_modules_ships() if lastStarport present
* The companion Session.query is called for *all* CAPI endpoints and only the /profile one will return lastStartport data, which is where ships/modules are if present, so only do these checks if we see lastStarport.
This commit is contained in:
parent
bd670b7ff1
commit
6ec24157f2
@ -137,7 +137,9 @@ class CAPIData(UserDict):
|
|||||||
|
|
||||||
self.original_data = self.data.copy() # Just in case
|
self.original_data = self.data.copy() # Just in case
|
||||||
|
|
||||||
self.check_modules_ships()
|
# Only the /profile end point has star port, and thus ships/modules.
|
||||||
|
if self.data.get('lastStarport'):
|
||||||
|
self.check_modules_ships()
|
||||||
|
|
||||||
def check_modules_ships(self) -> None:
|
def check_modules_ships(self) -> None:
|
||||||
modules: Dict[str, Any] = self.data['lastStarport'].get('modules')
|
modules: Dict[str, Any] = self.data['lastStarport'].get('modules')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user