Skip to content

Commit d362a1d

Browse files
committed
improve user statement
1 parent bbd72e1 commit d362a1d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

futuramaapi/routers/services/_base_template.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ def request(self) -> Request:
5858

5959
@property
6060
def __auth_session_statement(self) -> Select[tuple[AuthSessionModel]]:
61-
statement: Select[tuple[AuthSessionModel]] = select(AuthSessionModel)
62-
statement = statement.where(AuthSessionModel.key == self.request.cookies[self._cookie_auth_key])
63-
statement = statement.options(selectinload(AuthSessionModel.user))
64-
return statement
61+
return (
62+
select(AuthSessionModel)
63+
.where(AuthSessionModel.key == self.request.cookies[self._cookie_auth_key])
64+
.options(selectinload(AuthSessionModel.user))
65+
)
6566

6667
async def _get_current_user(self) -> UserModel | None:
6768
if self._cookie_auth_key not in self.request.cookies:

0 commit comments

Comments
 (0)