def delete(self, data, token): user = sess.query(User).filter(User.id==data['id']).first() if user is not None: if user.token != token: return throw_error(400, 'Bad token') sess.delete(user) sess.commit() return throw_error(200, 'null') else: return throw_error(400, 'No such user')
def delete_option(key): sess.delete(get_option(key)) sess.commit()
def unregister(id): sess.delete(get_user(id)) sess.commit()