Get a user by OAuth account. :param oauth: Name of the OAuth client. :param account_id: Id of the account on the external OAuth service. :raises UserNotExists: The user does not exist. :return: A user of type models.UP.
(self, oauth: str, account_id: str)
| 92 | return user |
| 93 | |
| 94 | async def get_by_oauth_account(self, oauth: str, account_id: str) -> models.UP: |
| 95 | """ |
| 96 | Get a user by OAuth account. |
| 97 | |
| 98 | :param oauth: Name of the OAuth client. |
| 99 | :param account_id: Id of the account on the external OAuth service. |
| 100 | :raises UserNotExists: The user does not exist. |
| 101 | :return: A user of type models.UP. |
| 102 | """ |
| 103 | user = await self.user_db.get_by_oauth_account(oauth, account_id) |
| 104 | |
| 105 | if user is None: |
| 106 | raise exceptions.UserNotExists() |
| 107 | |
| 108 | return user |
| 109 | |
| 110 | async def create( |
| 111 | self, |