Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New serializers #348

Merged
merged 3 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading