예제 #1
0
    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')
예제 #2
0
def delete_option(key):
    sess.delete(get_option(key))
    sess.commit()
예제 #3
0
def unregister(id):
    sess.delete(get_user(id))
    sess.commit()