Remove list endpoint and related methods

This commit is contained in:
François Voron
2020-04-25 11:46:20 +02:00
parent f37e4b90df
commit a9ee467518
13 changed files with 5 additions and 134 deletions

View File

@ -1,4 +1,4 @@
from typing import List, Mapping, Optional, Type
from typing import Mapping, Optional, Type
from databases import Database
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, Table, select
@ -75,11 +75,6 @@ class SQLAlchemyUserDatabase(BaseUserDatabase[UD]):
self.users = users
self.oauth_accounts = oauth_accounts
async def list(self) -> List[UD]:
query = self.users.select()
users = await self.database.fetch_all(query)
return [await self._make_user(user) for user in users]
async def get(self, id: str) -> Optional[UD]:
query = self.users.select().where(self.users.c.id == id)
user = await self.database.fetch_one(query)