fix deleting items

This commit is contained in:
j 2014-05-22 11:20:30 +02:00
parent 5bbf612a38
commit 0a95189a52
2 changed files with 5 additions and 0 deletions

View File

@ -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)

View File

@ -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):