diff --git a/oml/item/models.py b/oml/item/models.py index edddf08..6fb6312 100644 --- a/oml/item/models.py +++ b/oml/item/models.py @@ -398,6 +398,7 @@ class Item(db.Model): db.session.commit() if not self.users: db.session.delete(self) + Sort.query.filter_by(item_id=self.id).delete() else: self.update() Changelog.record(user, 'removeitem', self.id) diff --git a/oml/oxtornado.py b/oml/oxtornado.py index f71e47f..48b3712 100644 --- a/oml/oxtornado.py +++ b/oml/oxtornado.py @@ -100,6 +100,10 @@ class ApiHandler(tornado.web.RequestHandler): def initialize(self, app): self._app = app + def get(self): + self.write('use POST') + self.finish() + @tornado.web.asynchronous @tornado.gen.coroutine def post(self):