def delete_user(id): deleted = UserModel.delete_by_id(id=id) if deleted: print('successfully deleted') return redirect(url_for('users')) else: print('record not found') return redirect(url_for('users'))
def delete(self, id): try: user = UserModel.delete_by_id(id) return {"status": "User successfully deleted"}, 200 except KeyError as e: api.abort(500, e.__doc__, status="Could not perform this action", statusCode="500") except KeyError as e: api.abort(400, e.__doc__, status="Could not perform this action", statusCode="400")