Skip to content

Commit bd1a4d8

Browse files
committed
Rollback status for validation
Changes to be committed: modified: biocompute/apis.py
1 parent de6c25c commit bd1a4d8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

biocompute/apis.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,8 @@ def post(self, request):
767767
data = legacy_api_converter(data=request.data)
768768

769769
for index, object in enumerate(data):
770+
# import pdb; pdb.set_trace()
771+
response_id = object.get("object_id", index)
770772
bco_results = validator.parse_and_validate(bco=object)
771773
identifier, results = bco_results.popitem()
772774

@@ -782,7 +784,7 @@ def post(self, request):
782784
message = "BCO valid"
783785

784786
response_data.append(response_constructor(
785-
identifier = identifier,
787+
identifier = response_id,
786788
status=bco_status,
787789
code=status_code,
788790
message=message,
@@ -791,7 +793,7 @@ def post(self, request):
791793

792794
if accepted_requests is False and rejected_requests == True:
793795
return Response(
794-
status=status.HTTP_400_BAD_REQUEST,
796+
status=status.HTTP_207_MULTI_STATUS,
795797
data=response_data
796798
)
797799

0 commit comments

Comments
 (0)