Sistema limpio
This commit is contained in:
18
backend/fix_syntax.py
Normal file
18
backend/fix_syntax.py
Normal file
@@ -0,0 +1,18 @@
|
||||
with open("/app/app/api/v1/endpoints/users.py") as f:
|
||||
lines = f.readlines()
|
||||
|
||||
new_block = [
|
||||
" if current_user.role.value == 'ADMIN':\n",
|
||||
" query = select(User).where(User.id == user_id)\n",
|
||||
" else:\n",
|
||||
" query = select(User).where(\n",
|
||||
" User.id == user_id,\n",
|
||||
" User.tenant_id == current_user.tenant_id\n",
|
||||
" )\n",
|
||||
]
|
||||
|
||||
lines[150:161] = new_block
|
||||
|
||||
with open("/app/app/api/v1/endpoints/users.py", "w") as f:
|
||||
f.writelines(lines)
|
||||
print("Listo")
|
||||
Reference in New Issue
Block a user