address comments, rename to ENABLE_ADMIN_EXPORT

This commit is contained in:
Jun Siang Cheah 2024-04-22 19:55:46 +01:00
parent 190b934ab5
commit e2a8ad5fca
6 changed files with 11 additions and 14 deletions

View file

@ -28,10 +28,7 @@ from apps.web.models.tags import (
from constants import ERROR_MESSAGES
from config import (
SRC_LOG_LEVELS,
ALLOW_ADMIN_EXPORT
)
from config import SRC_LOG_LEVELS, ENABLE_ADMIN_EXPORT
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["MODELS"])
@ -82,7 +79,7 @@ async def get_all_user_chats(user=Depends(get_current_user)):
@router.get("/all/db", response_model=List[ChatResponse])
async def get_all_user_chats_in_db(user=Depends(get_admin_user)):
if not ALLOW_ADMIN_EXPORT:
if not ENABLE_ADMIN_EXPORT:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,

View file

@ -91,7 +91,7 @@ async def download_chat_as_pdf(
@router.get("/db/download")
async def download_db(user=Depends(get_admin_user)):
if not ALLOW_ADMIN_EXPORT:
if not ENABLE_ADMIN_EXPORT:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,