fix permissions issue
All checks were successful
Build Docker / deploy (push) Successful in 49s
Build Docker / build (push) Successful in 57s

This commit is contained in:
2026-05-17 19:14:42 +03:00
parent 57c88ab44b
commit ca966f0bc6
3 changed files with 7 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
#VENV=source ./.venv/bin/activate; VENV=source ./.venv/bin/activate;
#ALEMBIC=alembic -c ./server/backend/database/alembic/alembic.ini ALEMBIC=alembic -c ./server/backend/database/alembic/alembic.ini
VENV= .venv\Scripts\activate #Windows #VENV= .venv\Scripts\activate #Windows
ALEMBIC=alembic -c server\backend\database\alembic\alembic.ini #ALEMBIC=alembic -c server\backend\database\alembic\alembic.ini
.PHONY: run run_debug migrate_head migrate_down migrate_history migrate_current migrate_heads migrate_stamp migrate .PHONY: run run_debug migrate_head migrate_down migrate_history migrate_current migrate_heads migrate_stamp migrate
run: run:
$(VENV) python run.py --user_name admin $(VENV) python run.py --user_name admin

2
run.py
View File

@@ -22,7 +22,7 @@ async def init_admin(user_name: str):
def start(log_level: str): def start(log_level: str):
uvicorn.run( uvicorn.run(
"server.backend.endpoints.endpoints:api", "server.backend.endpoints.endpoints:api",
host="0.0.0.0", host="127.0.0.1",
port=settings.PORT, port=settings.PORT,
reload=False, reload=False,
log_level=log_level, log_level=log_level,

View File

@@ -31,7 +31,8 @@ async def update_user(data: pydantic.UserUpdate, user=Depends(get_current_user))
if not user_check: if not user_check:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="User not found") raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="User not found")
if not user_check.admin: if not user_check.admin:
if data.code != user_check.code: print(data.code)
if data.code != user_check.code and data.code:
raise HTTPException( raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN, status_code=status.HTTP_403_FORBIDDEN,
detail="Ordinary users cannot change their code" detail="Ordinary users cannot change their code"