Тест кода
This commit is contained in:
parent
cc37969360
commit
5639a9d7b6
1 changed files with 0 additions and 6 deletions
|
@ -1,4 +1,3 @@
|
||||||
import logging
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from pydantic import ValidationError
|
from pydantic import ValidationError
|
||||||
|
@ -17,7 +16,6 @@ class UserService:
|
||||||
async def find_user(uow: UnitOfWork, **find_by) -> SUser:
|
async def find_user(uow: UnitOfWork, **find_by) -> SUser:
|
||||||
try:
|
try:
|
||||||
async with RedisService() as redis:
|
async with RedisService() as redis:
|
||||||
logging.warning(f"find_by user: {find_by}")
|
|
||||||
user = await redis.get_value(key=f"user: {find_by}", model=SUser)
|
user = await redis.get_value(key=f"user: {find_by}", model=SUser)
|
||||||
return user
|
return user
|
||||||
except ValidationError:
|
except ValidationError:
|
||||||
|
@ -79,12 +77,8 @@ class UserService:
|
||||||
raise WrongCodeException
|
raise WrongCodeException
|
||||||
if verification_code != confirmation_code:
|
if verification_code != confirmation_code:
|
||||||
raise WrongCodeException
|
raise WrongCodeException
|
||||||
logging.warning(f"{confirmation_code=}")
|
|
||||||
logging.warning(f"{verification_code=}")
|
|
||||||
logging.warning(f"{verification_code == confirmation_code=}")
|
|
||||||
async with uow:
|
async with uow:
|
||||||
await uow.user.change_data(user_id=user.id, role=settings.VERIFICATED_USER)
|
await uow.user.change_data(user_id=user.id, role=settings.VERIFICATED_USER)
|
||||||
logging.warning(f"dict user: {dict(id=user.id)}")
|
|
||||||
async with RedisService() as redis:
|
async with RedisService() as redis:
|
||||||
await redis.delete_key(key=f"user: {dict(id=user.id)}")
|
await redis.delete_key(key=f"user: {dict(id=user.id)}")
|
||||||
await redis.set_key(
|
await redis.set_key(
|
||||||
|
|
Loading…
Add table
Reference in a new issue