thermobased / flask-webapp

0 stars 0 forks source link

Show user an error when trying to add a habit with a name that's already used #15

Closed gnull closed 1 month ago

gnull commented 2 months ago

If we try to add a habit with a name that already exists, the app just silently ignores the request and raises no error. There's an error in the terminal about Sqlite integrity, but nothing is displayed to the user.

https://github.com/thermobased/flask-webapp/blob/8f8207cbb57c3868c87742745e758a4a66e7bd46/main.py#L128-L131

Curiously, the backend already returns the info about this error. We only need to use it in the frontend and display to the user (e.g. by alerting).

Ivan

thermobased commented 1 month ago

Fixed in 024ede5ccb827fe9d330a1b85d4596679edad316, now also alerting same error on trying to edit to existing name.