diff --git a/makefile b/makefile index 7b46426..5143f4d 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ -#VENV=source ./.venv/bin/activate; -#ALEMBIC=alembic -c ./server/backend/database/alembic/alembic.ini -VENV= .venv\Scripts\activate #Windows -ALEMBIC=alembic -c server\backend\database\alembic\alembic.ini +VENV=source ./.venv/bin/activate; +ALEMBIC=alembic -c ./server/backend/database/alembic/alembic.ini +#VENV= .venv\Scripts\activate #Windows +#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 run: $(VENV) python run.py --user_name admin diff --git a/run.py b/run.py index e18ab08..c735d78 100644 --- a/run.py +++ b/run.py @@ -22,7 +22,7 @@ async def init_admin(user_name: str): def start(log_level: str): uvicorn.run( "server.backend.endpoints.endpoints:api", - host="0.0.0.0", + host="127.0.0.1", port=settings.PORT, reload=False, log_level=log_level, diff --git a/server/backend/endpoints/endpoints.py b/server/backend/endpoints/endpoints.py index 24bc108..f401cb1 100644 --- a/server/backend/endpoints/endpoints.py +++ b/server/backend/endpoints/endpoints.py @@ -31,7 +31,8 @@ async def update_user(data: pydantic.UserUpdate, user=Depends(get_current_user)) if not user_check: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="User not found") 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( status_code=status.HTTP_403_FORBIDDEN, detail="Ordinary users cannot change their code"