We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8a7f01 commit 06b1cf5Copy full SHA for 06b1cf5
simple_backend/src/task_tracker/main.py
@@ -11,7 +11,7 @@ def get_tasks():
11
@app.post("/tasks")
12
def create_task(name: str, condition: str = 'new'):
13
tasks = storage.load()
14
- new_id = max((task['id'] for task in tasks), start = 0) + 1
+ new_id = max((task['id'] for task in tasks), default = 0) + 1
15
task = {'id': new_id, 'name': name, 'condition': condition}
16
tasks.append(task)
17
storage.save(tasks)
simple_backend/src/task_tracker/tasks.json
@@ -0,0 +1 @@
1
+[]
0 commit comments