Skip to content

Commit bd7be60

Browse files
refactor templates, (mostly) implement organization page
1 parent cbaff74 commit bd7be60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1514
-504
lines changed

docs/templates.qmd

Lines changed: 0 additions & 321 deletions
This file was deleted.

exceptions/http_exceptions.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ def __init__(self):
4444
)
4545

4646

47-
# TODO: Consolidate these two into a single validation error
48-
class EmptyOrganizationNameError(HTTPException):
49-
def __init__(self):
47+
class OrganizationSetupError(HTTPException):
48+
def __init__(self, message: str = "Organization setup failed"):
5049
super().__init__(
51-
status_code=400,
52-
detail="Organization name cannot be empty"
50+
status_code=500,
51+
detail=message
5352
)
5453

5554

@@ -69,6 +68,22 @@ def __init__(self):
6968
)
7069

7170

71+
class UserNotFoundError(HTTPException):
72+
def __init__(self):
73+
super().__init__(
74+
status_code=404,
75+
detail="User not found"
76+
)
77+
78+
79+
class UserAlreadyMemberError(HTTPException):
80+
def __init__(self):
81+
super().__init__(
82+
status_code=400,
83+
detail="User is already a member of this organization"
84+
)
85+
86+
7287
class InvalidPermissionError(HTTPException):
7388
"""Raised when a user attempts to assign an invalid permission to a role"""
7489

main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from fastapi.responses import RedirectResponse
66
from fastapi.staticfiles import StaticFiles
77
from fastapi.templating import Jinja2Templates
8-
from fastapi.exceptions import RequestValidationError, StarletteHTTPException
8+
from fastapi.exceptions import RequestValidationError
9+
from starlette.exceptions import HTTPException as StarletteHTTPException
910
from routers import account, dashboard, organization, role, user, static_pages
1011
from utils.dependencies import (
1112
get_optional_user

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ dependencies = [
2727
dev = [
2828
"graphviz<1.0.0,>=0.20.3",
2929
"quarto<1.0.0,>=0.1.0",
30-
"mypy<2.0.0,>=1.11.2",
3130
"jupyter<2.0.0,>=1.1.1",
3231
"notebook<8.0.0,>=7.2.2",
3332
"pytest<9.0.0,>=8.3.3",
3433
"sqlalchemy-schemadisplay<3.0,>=2.0",
3534
"perplexity-cli",
35+
"mypy>=1.15.0",
3636
]
3737

3838
[tool.uv.sources]

0 commit comments

Comments
 (0)