osuosl / orvsd_central

5 stars 2 forks source link

add_object is not a very flexible method in controllers/api.py #108

Open Chetco opened 9 years ago

Chetco commented 9 years ago

There is no notification of a constraint failure when adding a site with a school_id which does not exist.

We should probably have a method for add_school so that proper error handling can occur on the field input with informative feedback.

justinnoah commented 9 years ago

@Chetco once #151 is merged, you may want to try again. It is possible there is a message and due to that bug, it wasn't being displayed. Not closing as the issue may still persist after merge.

Chetco commented 9 years ago

@brutal-chaos I don't see a message being flashed as of yet. The browser I am using is chromium. The latest commit I am using is: a11171a The traceback of the error I get is: https://pastebin.osuosl.org/16356/

Chetco commented 9 years ago

@justinnoah Using the same commit hash as before I don't see any messages being flashed. I do get an exception again when putting spam into the dev field. Here is the traceback: https://pastebin.osuosl.org/16686/ The database is a fresh import of the .csv file with a setup_db command.

justinnoah commented 9 years ago

@Chetco it sounds like the Flash messages are working as they should, ORVSD Central is not handling all errors gracefully (e.g. not all errors are flashing a message and are just dying). We are working on rewriting the forms which will include heavily modifying (or completely removing) add object. https://github.com/orvsd/orvsd_central/issues/150 is the bug for that.