15 lines
471 B
Python
15 lines
471 B
Python
with open("/app/app/api/v1/endpoints/users.py", "r") as f:
|
|
content = f.read()
|
|
|
|
old = " # Soft delete\n db_user.is_active = False\n await db.commit()"
|
|
new = " # Hard delete\n await db.delete(db_user)\n await db.commit()"
|
|
|
|
if old in content:
|
|
content = content.replace(old, new)
|
|
print("OK: hard delete aplicado")
|
|
else:
|
|
print("ERROR: bloque no encontrado")
|
|
|
|
with open("/app/app/api/v1/endpoints/users.py", "w") as f:
|
|
f.write(content)
|