db dates
This commit is contained in:
@@ -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): #Проверка пароля на соответствие сложности
|
||||
@@ -45,4 +47,5 @@ class UserReset(BaseModel):
|
||||
class UserOut(BaseModel):
|
||||
email:EmailStr
|
||||
description:str
|
||||
activated:bool
|
||||
activated:bool
|
||||
created_at:datetime
|
||||
Reference in New Issue
Block a user