DanielAndreasen / SWEETer-Cat

Make SWEET-Cat sweet again

Home Page:http://sweetercat.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disallow strings in limit choice.

jason-neal opened this issue · comments

Currently, if a string is in the min/max limits it crashes as in #12.

File "/home/jneal/Projects/SWEETer-Cat/sweetercat/app.py", line 199, in plot_exo
  x1, x2 = float(request.form['x1']), float(request.form['x2'])
  ValueError: could not convert string to float: '11 Com'

Maybe this could wrapped in a try-except and if it cannot be turned into a float then it pops up a little box letting the user know their limits were invalid etc. (instead of crashing).

How about just setting the limits to the min and max values if it fails?

That is probably the simpler solution.