Skip to content

Commit 182d1b1

Browse files
committed
Fix response status codes in DojoMetaViewSet for POST and PATCH methods
1 parent bf03cde commit 182d1b1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

dojo/api_v2/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,10 +1707,12 @@ def batch(self, request, pk=None):
17071707
if serialized_data.is_valid(raise_exception=True):
17081708
if request.method == "POST":
17091709
self.process_post(request.data)
1710+
status_code = status.HTTP_201_CREATED
17101711
if request.method == "PATCH":
17111712
self.process_patch(request.data)
1713+
status_code = status.HTTP_200_OK
17121714

1713-
return Response(status=status.HTTP_201_CREATED, data=serialized_data.data)
1715+
return Response(status=status_code, data=serialized_data.data)
17141716

17151717
def process_post(self: object, data: dict):
17161718
product = Product.objects.filter(id=data.get("product")).first()

0 commit comments

Comments
 (0)