db dates
This commit is contained in:
@@ -107,8 +107,8 @@ pytest
|
|||||||
✅ TODO
|
✅ TODO
|
||||||
```
|
```
|
||||||
• Миграции через Alembic
|
• Миграции через Alembic
|
||||||
• Обработка ошибок
|
• Обработка ошибок ✅
|
||||||
• Логирование
|
• Логирование ✅
|
||||||
• PostgreSQL + Pgpool-II для продакшена ✅
|
• PostgreSQL + Pgpool-II для продакшена ✅
|
||||||
• Разделение схем Pydantic на вход/выход ✅
|
• Разделение схем Pydantic на вход/выход ✅
|
||||||
• Тестирование edge-cases
|
• Тестирование edge-cases
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ async def protected(current_user: str = Depends(JWT.current_user)):
|
|||||||
@api.get("/", response_model=list[pydentic.UserOut]) #список!
|
@api.get("/", response_model=list[pydentic.UserOut]) #список!
|
||||||
async def get_all_rows(current_user: str = Depends(JWT.current_user)):
|
async def get_all_rows(current_user: str = Depends(JWT.current_user)):
|
||||||
users = await db.get_all_rows()
|
users = await db.get_all_rows()
|
||||||
if not user:
|
if not users:
|
||||||
raise HTTPException(status_code=401, detail="The user isn't found")
|
raise HTTPException(status_code=401, detail="The user isn't found")
|
||||||
return users
|
return users
|
||||||
@api.get("/get_user_by_email/{email}", response_model=pydentic.UserOut)
|
@api.get("/get_user_by_email/{email}", response_model=pydentic.UserOut)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from pydantic import BaseModel, Field, EmailStr, constr,validator
|
from pydantic import BaseModel, Field, EmailStr, constr,validator
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
#Валидация пароля
|
#Валидация пароля
|
||||||
import re
|
import re
|
||||||
def check_password_complexity(cls, password): #Проверка пароля на соответствие сложности
|
def check_password_complexity(cls, password): #Проверка пароля на соответствие сложности
|
||||||
@@ -46,3 +48,4 @@ class UserOut(BaseModel):
|
|||||||
email:EmailStr
|
email:EmailStr
|
||||||
description:str
|
description:str
|
||||||
activated:bool
|
activated:bool
|
||||||
|
created_at:datetime
|
||||||
Reference in New Issue
Block a user