-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EmailSignUp token creation done, refined routes
- Loading branch information
1 parent
a15db8d
commit 441b636
Showing
8 changed files
with
54 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,20 +6,20 @@ | |
|
||
class EmailSignUpCrud(BaseCrud): | ||
async def create_email_signup_token(self, email: str) -> EmailSignUpToken: | ||
token = EmailSignUpToken.create(email=email) | ||
await self._add_item(token) | ||
return token | ||
signup_token = EmailSignUpToken.create(email=email) | ||
await self._add_item(signup_token) | ||
return signup_token | ||
|
||
async def get_email_signup_token(self, token: str) -> EmailSignUpToken | None: | ||
return await self._get_item(token, EmailSignUpToken, throw_if_missing=False) | ||
async def get_email_signup_token(self, id: str) -> EmailSignUpToken | None: | ||
|
||
async def delete_email_signup_token(self, token: str) -> None: | ||
await self._delete_item(token) | ||
return await self._get_item(id, EmailSignUpToken, throw_if_missing=False) | ||
|
||
async def delete_email_signup_token(self, id: str) -> None: | ||
await self._delete_item(id) | ||
|
||
|
||
async def test_adhoc() -> None: | ||
async with EmailSignUpCrud() as crud: | ||
token = await crud.create_email_signup_token(email="[email protected]") | ||
retrieved_token = await crud.get_email_signup_token(token.token) | ||
print(f"Retrieved Token: {retrieved_token}") | ||
await crud.delete_email_signup_token(token.token) | ||
signup_token = await crud.create_email_signup_token(email="[email protected]") | ||
await crud.get_email_signup_token(signup_token.id) | ||
await crud.delete_email_signup_token(signup_token.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters