Skip to content

Commit a74bdf5

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b11e34f commit a74bdf5

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

‎flask-todo/src/worker.py‎

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
from werkzeug.exceptions import HTTPException
77
from workers import WorkerEntrypoint, wsgi
88

9-
10-
119
app = Flask(__name__)
1210
# Preserve the field order used below rather than sorting keys alphabetically.
1311
app.json.sort_keys = False
@@ -67,10 +65,7 @@ def create_todo():
6765
)
6866

6967
row = run_sync(
70-
_db()
71-
.prepare("SELECT * FROM todos WHERE id = ?")
72-
.bind(todo_id)
73-
.first()
68+
_db().prepare("SELECT * FROM todos WHERE id = ?").bind(todo_id).first()
7469
)
7570

7671
return jsonify(_row_to_todo(row))
@@ -85,10 +80,7 @@ def delete_all_todos():
8580
@app.get("/todos/<todo_id>")
8681
def get_todo(todo_id: str):
8782
row = run_sync(
88-
_db()
89-
.prepare("SELECT * FROM todos WHERE id = ?")
90-
.bind(todo_id)
91-
.first()
83+
_db().prepare("SELECT * FROM todos WHERE id = ?").bind(todo_id).first()
9284
)
9385
if row is None:
9486
return jsonify({"error": "not found"})
@@ -120,10 +112,7 @@ def update_todo(todo_id: str):
120112
)
121113

122114
row = run_sync(
123-
_db()
124-
.prepare("SELECT * FROM todos WHERE id = ?")
125-
.bind(todo_id)
126-
.first()
115+
_db().prepare("SELECT * FROM todos WHERE id = ?").bind(todo_id).first()
127116
)
128117
if row is None:
129118
return jsonify({"error": "not found"})

0 commit comments

Comments
 (0)