Skip to content

Working organization page #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Make sure the development database is running and tables and default
permissions/roles are created first.

``` bash
uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload
uv run python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload
```

Navigate to http://localhost:8000/
Expand Down
2 changes: 1 addition & 1 deletion docs/static/documentation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ docker compose up -d
Make sure the development database is running and tables and default permissions/roles are created first.

``` bash
uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload
uv run python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload
```

Navigate to http://localhost:8000/
Expand Down
321 changes: 0 additions & 321 deletions docs/templates.qmd

This file was deleted.

25 changes: 20 additions & 5 deletions exceptions/http_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ def __init__(self):
)


# TODO: Consolidate these two into a single validation error
class EmptyOrganizationNameError(HTTPException):
def __init__(self):
class OrganizationSetupError(HTTPException):
def __init__(self, message: str = "Organization setup failed"):
super().__init__(
status_code=400,
detail="Organization name cannot be empty"
status_code=500,
detail=message
)


Expand All @@ -69,6 +68,22 @@ def __init__(self):
)


class UserNotFoundError(HTTPException):
def __init__(self):
super().__init__(
status_code=404,
detail="User not found"
)


class UserAlreadyMemberError(HTTPException):
def __init__(self):
super().__init__(
status_code=400,
detail="User is already a member of this organization"
)


class InvalidPermissionError(HTTPException):
"""Raised when a user attempts to assign an invalid permission to a role"""

Expand Down
2 changes: 1 addition & 1 deletion index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ docker compose up -d
Make sure the development database is running and tables and default permissions/roles are created first.

``` bash
uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload
uv run python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload
```

Navigate to http://localhost:8000/
Expand Down
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from fastapi.responses import RedirectResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from fastapi.exceptions import RequestValidationError, StarletteHTTPException
from fastapi.exceptions import RequestValidationError
from starlette.exceptions import HTTPException as StarletteHTTPException
from routers import account, dashboard, organization, role, user, static_pages
from utils.dependencies import (
get_optional_user
Expand Down
Loading