Exemplo n.º 1
0
def delete_user(user):

    if request.method == 'DELETE' or (request.method == 'POST' and request.json['_method'] == 'delete'):
        try:
            response = db.delete_user(user)
        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
Exemplo n.º 2
0
def delete_user(user):

    if request.method == 'DELETE' or (request.method == 'POST' and request.json['_method'] == 'delete'):
        try:
            response = db.delete_user(user)
        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
Exemplo n.º 3
0
 def delete(self) -> bool:
     return db.delete_user(self.id)
Exemplo n.º 4
0
Arquivo: user.py Projeto: 3IWOH/alerta
 def delete(self):
     return db.delete_user(self.id)
Exemplo n.º 5
0
 def delete(self):
     return db.delete_user(self.id)