Skip to content

Commit 03ee2fe

Browse files
Merge pull request #115 from Promptly-Technologies-LLC/57-fully-implement-and-test-the-templatesuserorganizationhtml-page
Working organization page
2 parents cbaff74 + 49f55ad commit 03ee2fe

Some content is hidden

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

52 files changed

+1658
-576
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Make sure the development database is running and tables and default
164164
permissions/roles are created first.
165165

166166
``` bash
167-
uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload
167+
uv run python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload
168168
```
169169

170170
Navigate to http://localhost:8000/

docs/static/documentation.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ docker compose up -d
129129
Make sure the development database is running and tables and default permissions/roles are created first.
130130

131131
``` bash
132-
uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload
132+
uv run python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload
133133
```
134134

135135
Navigate to http://localhost:8000/

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

index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ docker compose up -d
131131
Make sure the development database is running and tables and default permissions/roles are created first.
132132

133133
``` bash
134-
uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload
134+
uv run python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload
135135
```
136136

137137
Navigate to http://localhost:8000/

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

0 commit comments

Comments
 (0)