Skip to content

Commit

Permalink
cs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nekufa committed Nov 15, 2023
1 parent bacc319 commit 74aaff0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion registry/drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ async def find_one(
if len(rows):
return rows[0]

return None

async def find_or_create(
self, entity: type[Entity], query: dict, data: dict
) -> dict:
Expand All @@ -41,7 +43,7 @@ async def find_or_fail(
) -> dict:
instance = await self.find_one(entity, queries)
if not instance:
raise LookupError(f'{entity.nick} not found')
raise LookupError(f'{entity.__name__} not found')

return instance

Expand Down
4 changes: 2 additions & 2 deletions registry/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ def get_repository(self, cls: type[Repository]) -> Repository:

return self.repositories[cls]

async def bootstrap(self):
async def bootstrap(self) -> None:
if self.ready:
return

primary: Optional[Storage] = None
self.ready = True

primary: Optional[Storage] = None
for candidate in self.storages:
if candidate.id == StorageRepository.storage_id:
primary = self.storages[0]
Expand Down

0 comments on commit 74aaff0

Please sign in to comment.