Minor tweaks to routes and frontend. Added generated routes from openapi.json
This commit is contained in:
1 parent
75b2b1e142
commit
39b99d5509
9 files changed
+8717
-8084
No files matched your search
@@ -4,6 +4,7 @@ from sqlmodel import select
|
||||
|
||||
from fastapi import APIRouter
|
||||
from app.api.dependencies import SessionDep
|
||||
from app.core.config import settings
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -15,7 +16,7 @@ async def health_check() -> bool:
|
||||
return True
|
||||
|
||||
|
||||
@router.get("/test-db/")
|
||||
@router.get("/test-db/", include_in_schema=settings.is_local_environment)
|
||||
async def test_db(session: SessionDep) -> bool:
|
||||
try:
|
||||
session.exec(select(1))
|
||||
|
||||
@@ -83,6 +83,11 @@ class Settings(BaseSettings):
|
||||
def emails_enabled(self) -> bool:
|
||||
return bool(self.SMTP_HOST and self.EMAILS_FROM_EMAIL)
|
||||
|
||||
@computed_field
|
||||
@property
|
||||
def is_local_environment(self) -> bool:
|
||||
return self.ENVIRONMENT == "local"
|
||||
|
||||
EMAIL_TEST_USER: EmailStr = "test@example.com"
|
||||
FIRST_SUPERUSER: EmailStr
|
||||
FIRST_SUPERUSER_PASSWORD: str
|
||||
|
||||
Reference in new issue
Block a user