示例#1
0
def delete_perm(perm):

    if request.method == 'DELETE' or (request.method == 'POST'
                                      and request.json['_method'] == 'delete'):
        try:
            response = db.delete_perm(perm)
        except Exception as e:
            return jsonify(status="error", message=str(e)), 500

        if response:
            return jsonify(status="ok")
        else:
            return jsonify(status="error", message="not found"), 404
示例#2
0
 def delete(self):
     return db.delete_perm(self.id)
示例#3
0
 def delete(self) -> bool:
     return db.delete_perm(self.id)
示例#4
0
 def delete(self) -> bool:
     return db.delete_perm(self.id)
示例#5
0
 def delete(self):
     return db.delete_perm(self.id)