Browse Source

emergency bugfix

main
Madiwka 1 year ago
parent
commit
69be758445
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      app/apis/v1/route_user.py

+ 2
- 2
app/apis/v1/route_user.py View File

@@ -4,7 +4,7 @@ from sqlalchemy.orm import Session
from fastapi import Depends from fastapi import Depends
from typing import List, Annotated from typing import List, Annotated
from apis.v1.route_auth import get_current_user from apis.v1.route_auth import get_current_user
from core.config import Settings
from core.config import settings
from db.models.user import User from db.models.user import User
from schemas.user import UserCreate, ShowUser, ShowDriver, DriverCreate from schemas.user import UserCreate, ShowUser, ShowDriver, DriverCreate
from db.session import get_db from db.session import get_db
@@ -27,7 +27,7 @@ def create_user(
db: Session = Depends(get_db), db: Session = Depends(get_db),
current_user: User = Depends(get_current_user), current_user: User = Depends(get_current_user),
): ):
if user.Role not in Settings.ALLOWED_ROLES:
if user.Role not in settings.ALLOWED_ROLES:
raise HTTPException( raise HTTPException(
status_code=400, status_code=400,
detail=f"Status {status} is not allowed. Allowed status are {settings.ALLOWED_TASK_STATUS}", detail=f"Status {status} is not allowed. Allowed status are {settings.ALLOWED_TASK_STATUS}",


Loading…
Cancel
Save