mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: org creation bug
This commit is contained in:
parent
0e2e66d0e6
commit
509f826f32
1 changed files with 5 additions and 2 deletions
|
|
@ -87,8 +87,11 @@ async def create_org(
|
|||
|
||||
org = Organization.from_orm(org_object)
|
||||
|
||||
# RBAC check
|
||||
await rbac_check(request, org.org_uuid, current_user, "create", db_session)
|
||||
if isinstance(current_user,AnonymousUser):
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_409_CONFLICT,
|
||||
detail="You should be logged in to be able to achieve this action",
|
||||
)
|
||||
|
||||
# Complete the org object
|
||||
org.org_uuid = f"org_{uuid4()}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue