Update app.py
Browse files
app.py
CHANGED
|
@@ -691,6 +691,27 @@ def delete_task(task_id):
|
|
| 691 |
return jsonify({'success': True})
|
| 692 |
|
| 693 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 694 |
# ------------------------------------------------------------------ #
|
| 695 |
# ARRANQUE
|
| 696 |
# ------------------------------------------------------------------ #
|
|
|
|
| 691 |
return jsonify({'success': True})
|
| 692 |
|
| 693 |
|
| 694 |
+
|
| 695 |
+
# ------------------------------------------------------------------ #
|
| 696 |
+
# DEBUG — borrar después de confirmar que funciona
|
| 697 |
+
# ------------------------------------------------------------------ #
|
| 698 |
+
@app.route('/api/debug', methods=['GET'])
|
| 699 |
+
def debug():
|
| 700 |
+
import sqlite3
|
| 701 |
+
try:
|
| 702 |
+
conn = db.get_connection()
|
| 703 |
+
users = conn.execute("SELECT userID, username, role FROM Users").fetchall()
|
| 704 |
+
conn.close()
|
| 705 |
+
return jsonify({
|
| 706 |
+
'db_path': db.db_path,
|
| 707 |
+
'db_exists': os.path.exists(db.db_path),
|
| 708 |
+
'users': [dict(u) for u in users],
|
| 709 |
+
'model_loaded': model is not None
|
| 710 |
+
})
|
| 711 |
+
except Exception as e:
|
| 712 |
+
return jsonify({'error': str(e), 'db_path': db.db_path})
|
| 713 |
+
|
| 714 |
+
|
| 715 |
# ------------------------------------------------------------------ #
|
| 716 |
# ARRANQUE
|
| 717 |
# ------------------------------------------------------------------ #
|