mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
Alter: 400 to more specific 409 conflict status code
This commit is contained in:
parent
6d76a6f19b
commit
a327c9c95d
2 changed files with 11 additions and 10 deletions
|
|
@ -93,7 +93,9 @@ async def update_install_instance(
|
|||
|
||||
|
||||
# Install Default roles
|
||||
async def install_default_elements( data: dict, db_session: Session):
|
||||
async def install_default_elements(db_session: Session):
|
||||
"""
|
||||
"""
|
||||
# remove all default roles
|
||||
statement = select(Role).where(Role.role_type == RoleTypeEnum.TYPE_GLOBAL)
|
||||
roles = db_session.exec(statement).all()
|
||||
|
|
@ -315,7 +317,7 @@ async def install_create_organization_user(
|
|||
|
||||
if not org.first():
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
status_code=409,
|
||||
detail="Organization does not exist",
|
||||
)
|
||||
|
||||
|
|
@ -325,7 +327,7 @@ async def install_create_organization_user(
|
|||
|
||||
if result.first():
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
status_code=409,
|
||||
detail="Username already exists",
|
||||
)
|
||||
|
||||
|
|
@ -335,7 +337,7 @@ async def install_create_organization_user(
|
|||
|
||||
if result.first():
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
status_code=409,
|
||||
detail="Email already exists",
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue