From 96723ab4886e0dabc78e73855fb4e558488616f0 Mon Sep 17 00:00:00 2001 From: 0xJan <34775247+jankadel@users.noreply.github.com> Date: Thu, 30 Nov 2023 19:33:30 +0100 Subject: [PATCH] allow to optionally pass with_children and fetch_links to properly use beanie inheritance features in get_by_email --- fastapi_users_db_beanie/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastapi_users_db_beanie/__init__.py b/fastapi_users_db_beanie/__init__.py index 6a73f7f..d836553 100644 --- a/fastapi_users_db_beanie/__init__.py +++ b/fastapi_users_db_beanie/__init__.py @@ -69,10 +69,10 @@ async def get(self, id: ID) -> Optional[UP_BEANIE]: """Get a single user by id.""" return await self.user_model.get(id) # type: ignore - async def get_by_email(self, email: str) -> Optional[UP_BEANIE]: + async def get_by_email(self, email: str, with_children: bool = False, fetch_links = False) -> Optional[UP_BEANIE]: """Get a single user by email.""" return await self.user_model.find_one( - self.user_model.email == email, + self.user_model.email == email, with_children=with_children, fetch_links=fetch_links collation=self.user_model.Settings.email_collation, )