|
|
@@ -50,6 +50,10 @@ def create_user( |
|
|
|
# if current_user.Role != "Admin": |
|
|
|
# raise HTTPException(status_code=403, detail="You are not authorized to perform this action") |
|
|
|
user = create_new_user(user=user, db=db) |
|
|
|
if user == "userExists": |
|
|
|
raise HTTPException( |
|
|
|
status_code=400, detail=f"User with this email already exists" |
|
|
|
) |
|
|
|
return user |
|
|
|
|
|
|
|
|
|
|
@@ -64,6 +68,10 @@ def create_driver( |
|
|
|
status_code=403, detail="You are not authorized to perform this action" |
|
|
|
) |
|
|
|
driver = create_new_driver(driver=driver, db=db) |
|
|
|
if driver == "userExists": |
|
|
|
raise HTTPException( |
|
|
|
status_code=400, detail=f"User with this email already exists" |
|
|
|
) |
|
|
|
return driver |
|
|
|
|
|
|
|
|
|
|
|