patrickloeber / python-fun

Some fun and useful projects with Python
MIT License
725 stars 561 forks source link

Bad Error Handling #14

Closed theluiscarbonell closed 1 year ago

theluiscarbonell commented 1 year ago

Current Behavior

If a user were to click on the checkbox twice, then click the "update" button, it would change the status of the task despite there not being an actual change.

https://github.com/patrickloeber/python-fun/blob/dc8aa51d9282a7baed8240ebc7db1b4bcafc7f7c/webapps/flask/app.py#L43

Expected Behavior

When a user clicks the "update" button, w.e. the status of the checkbox is should be what the todo.complete value is set to.

Notes, Thoughts, Comments

This might require changing the handler from a GET to a PUT request so that data can be passed in; or, using a <form> in the HTML.