You've already forked RekomenciBackend
fix(): revert filtered entities solution as it sucks ass
This commit is contained in:
@@ -13,8 +13,7 @@ class DefaultUnitOfWork(UnitOfWork):
|
||||
|
||||
@override
|
||||
async def add(self, *entities: Any) -> None:
|
||||
filtered_entities = [copy.copy(entity) if isinstance(entity, Entity) else entity for entity in entities]
|
||||
self._session.add_all(filtered_entities)
|
||||
self._session.add_all(entities)
|
||||
await self._session.flush()
|
||||
|
||||
@override
|
||||
|
||||
@@ -11,14 +11,14 @@ UserId = NewType("UserId", UUID)
|
||||
|
||||
@to_entity
|
||||
class User(Entity[UserId]):
|
||||
email: str
|
||||
hashed_password: str
|
||||
email: str | None
|
||||
hashed_password: str | None
|
||||
|
||||
@classmethod
|
||||
def factory(
|
||||
cls,
|
||||
email: str,
|
||||
hashed_password: str,
|
||||
email: str | None = None,
|
||||
hashed_password: str | None = None,
|
||||
) -> Self:
|
||||
return cls(
|
||||
id=UserId(uuid7()),
|
||||
|
||||
Reference in New Issue
Block a user