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