Fix fields for PurchaseOrderCancelSerializer (#7481)

- Throwing an error on an OPTIONS request
This commit is contained in:
Oliver authored and GitHub committed 2024-06-20 20:48:15 +10:00
1 parent 545ab9205b
commit 758871b8a9
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -270,7 +270,7 @@ class PurchaseOrderCancelSerializer(serializers.Serializer):
class Meta:
"""Metaclass options."""
fields = ([],)
fields = []
def get_context_data(self):
"""Return custom context information about the order."""
+3
View File
@@ -484,6 +484,9 @@ class PurchaseOrderTest(OrderTest):
url = reverse('api-po-cancel', kwargs={'pk': po.pk})
# Get an OPTIONS request from the endpoint
self.options(url, data={'context': True}, expected_code=200)
# Try to cancel the PO, but without required permissions
self.post(url, {}, expected_code=403)