thermobased / flask-webapp

0 stars 0 forks source link

Database integrity error when adding datapoints without selecting a habit #13

Closed gnull closed 3 months ago

gnull commented 3 months ago
  1. Open /profile.
  2. Without selecting a habit, try to add a datapoint.
  3. Nothing happens in the web interface, but flask prints datapoint already exists!, <class 'sqlite3.IntegrityError'> in the terminal.

We need to disable the datapoint creation form when no habit is selected. Or display an error and refuse to add datapoints.

Ivan

thermobased commented 3 months ago

Fixed in 436a4829ac42111788843fbcbff2a7d0b32fc9c4 by preselecting first habit on page load, since there is never any reason to have no habit selected in tracking view.