fix: edit_row default {} → None (Jinja2 truthy bug), init_db with app_context, add README
This commit is contained in:
@@ -86,7 +86,7 @@ def index():
|
||||
return redirect(url_for("index"))
|
||||
|
||||
# --- GET: список + форма редактирования ---
|
||||
edit_row = {}
|
||||
edit_row = None
|
||||
edit_id = request.args.get("edit")
|
||||
if edit_id:
|
||||
cur.execute(
|
||||
@@ -112,5 +112,6 @@ def index():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
init_db()
|
||||
with app.app_context():
|
||||
init_db()
|
||||
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 5000)), debug=False)
|
||||
|
||||
Reference in New Issue
Block a user