fix deleting items
This commit is contained in:
parent
5bbf612a38
commit
0a95189a52
2 changed files with 5 additions and 0 deletions
|
@ -398,6 +398,7 @@ class Item(db.Model):
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
if not self.users:
|
if not self.users:
|
||||||
db.session.delete(self)
|
db.session.delete(self)
|
||||||
|
Sort.query.filter_by(item_id=self.id).delete()
|
||||||
else:
|
else:
|
||||||
self.update()
|
self.update()
|
||||||
Changelog.record(user, 'removeitem', self.id)
|
Changelog.record(user, 'removeitem', self.id)
|
||||||
|
|
|
@ -100,6 +100,10 @@ class ApiHandler(tornado.web.RequestHandler):
|
||||||
def initialize(self, app):
|
def initialize(self, app):
|
||||||
self._app = app
|
self._app = app
|
||||||
|
|
||||||
|
def get(self):
|
||||||
|
self.write('use POST')
|
||||||
|
self.finish()
|
||||||
|
|
||||||
@tornado.web.asynchronous
|
@tornado.web.asynchronous
|
||||||
@tornado.gen.coroutine
|
@tornado.gen.coroutine
|
||||||
def post(self):
|
def post(self):
|
||||||
|
|
Loading…
Reference in a new issue