mirror of
https://github.com/joaovitoriasilva/endurain.git
synced 2026-05-03 03:00:41 -04:00
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.
18 lines
484 B
Python
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
|