Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
396 B
1
Indexable
Never
@app.route('/complete/<int:id>', methods=['GET', 'POST'])
def complete(id):
    task = Todo.query.get_or_404(id)
    task_to_complete = task.task_complete
    if task_to_complete == False:
        task_to_complete = True
    else:
        task_to_complete = False
    try:
        db.session.commit()
        return redirect('/')
    except:
        return "There was a problem marking your task"