def delete(self, type_):
"""Delete a non Collection class item."""
if get_authentication():
if request.authorization is None:
return failed_authentication()
else:
auth = check_authorization(request, get_session())
if auth is False:
return failed_authentication()
if checkEndpoint("DELETE", type_):
# No Delete Operation for collections
if type_ in get_doc().parsed_classes and type_+"Collection" not in get_doc().collections:
try:
crud.delete_single(type_, session=get_session())
response = {"message": "Object successfully deleted"}
return set_response_headers(jsonify(response))
except Exception as e:
status_code, message = e.get_HTTP()
return set_response_headers(jsonify(message), status_code=status_code)
abort(405)
评论列表
文章目录