Skip to content

Commit

Permalink
Merge pull request #348 from napse-invest/new-serializers
Browse files Browse the repository at this point in the history
New serializers
  • Loading branch information
Xenepix authored Mar 15, 2024
2 parents ae5707e + 272af18 commit f20f4db
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions django_napse/api/api_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion django_napse/api/bots/serializers/bot_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion django_napse/api/fleets/serializers/fleet_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f20f4db

Please sign in to comment.