fix(): revert filtered entities solution as it sucks ass

This commit is contained in:
doas root
2025-11-17 23:38:24 +03:00
parent 393f66a206
commit 63a057b020
2 changed files with 5 additions and 6 deletions
@@ -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()),