tornado-utils / tornado-restless

Insprired on flask-restless and sqlalchemy api wrapping for tornado
42 stars 14 forks source link

In "handler.py" self.finish() get called twice and raises an exception #11

Open massimiliano-della-rovere opened 9 years ago

massimiliano-della-rovere commented 9 years ago

Every time a request interacts with the DB via SQLAlchemy and causes an error (e.g. breaking a unique constraint, non-existent column, etc), a RuntimeError is raised by Tornado because the self.finish() method is called twice in Tornado Restless.

This patch assures that in the "patch", "delete", "put", "post", "get" methods call "self.finish(result)" only once.

You can find a detailed description of the causes in tornado-utils#10