Files
endurain/backend/app/server_settings/utils.py
João Vitória Silva 9acf4ce25c Add admin approval workflow for user sign-up
Introduces backend and frontend support for admin approval of user registrations. Adds API endpoint and logic to approve users, updates user models and schemas, and enhances UI to allow admins to approve or reject pending users. Removes unused email verification token field and refactors server settings access. Updates i18n and user service for new approval actions.
2025-09-11 15:48:12 +01:00

18 lines
484 B
Python

from fastapi import HTTPException, status
from sqlalchemy.orm import Session
import server_settings.crud as server_settings_crud
def get_server_settings(db: Session):
server_settings = server_settings_crud.get_server_settings(db)
if not server_settings:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail="Server settings not found",
headers={"WWW-Authenticate": "Bearer"},
)
return server_settings