From 207f18050c1480e507591cfe1bd03703476882d6 Mon Sep 17 00:00:00 2001 From: Xenepix Date: Sat, 16 Mar 2024 00:41:08 +0100 Subject: [PATCH 1/2] remove print --- django_napse/api/api_urls.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/django_napse/api/api_urls.py b/django_napse/api/api_urls.py index 77621e19..9fe64ca0 100644 --- a/django_napse/api/api_urls.py +++ b/django_napse/api/api_urls.py @@ -28,9 +28,7 @@ def build_main_router() -> DefaultRouter: for module_name in api_modules_folders_names: try: module: ModuleType = import_module(f"django_napse.api.{module_name}.views") - except (ImportError, ModuleNotFoundError) as error: - print(f"Could not import module {module_name} ({type(error)})") - print(error) + except (ImportError, ModuleNotFoundError): continue for obj in vars(module).values(): if isinstance(obj, type) and issubclass(obj, GenericViewSet): From 414e3edd4c63e1b7d119c9c5c23c6aa85fe9caa7 Mon Sep 17 00:00:00 2001 From: Xenepix Date: Sat, 16 Mar 2024 00:42:46 +0100 Subject: [PATCH 2/2] fix(fleet): fix bad currency serialization in fleet's serializer --- django_napse/api/bots/serializers/bot_serializers.py | 1 - django_napse/api/fleets/serializers/fleet_serializers.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/django_napse/api/bots/serializers/bot_serializers.py b/django_napse/api/bots/serializers/bot_serializers.py index c6eab33c..1c1dcef4 100644 --- a/django_napse/api/bots/serializers/bot_serializers.py +++ b/django_napse/api/bots/serializers/bot_serializers.py @@ -52,7 +52,6 @@ def get_space(self, instance: Bot) -> UUID | None: # noqa: ARG002 """Return the space used for the space containerization.""" if self.space is None: return None - print("UUID", type(self.space.uuid)) return self.space.uuid def get_exchange_account(self, instance: Bot) -> UUID | None: diff --git a/django_napse/api/fleets/serializers/fleet_serializers.py b/django_napse/api/fleets/serializers/fleet_serializers.py index e8e7d567..7fd8c790 100644 --- a/django_napse/api/fleets/serializers/fleet_serializers.py +++ b/django_napse/api/fleets/serializers/fleet_serializers.py @@ -153,7 +153,7 @@ def get_wallet(self, instance: Fleet) -> list[dict[str, float | str]] | None: def _search_ticker(ticker: str, merged_wallet: list[dict[str, str | float]]) -> int | None: """Return the index of the currency in the list if found, None otherwise.""" for i, currency in enumerate(merged_wallet): - if currency.get("ticker").ticker == ticker: + if currency.get("ticker") == ticker: return i return None