diff --git a/src/backend/InvenTree/order/serializers.py b/src/backend/InvenTree/order/serializers.py index a1da09f21b..6c16977871 100644 --- a/src/backend/InvenTree/order/serializers.py +++ b/src/backend/InvenTree/order/serializers.py @@ -271,7 +271,7 @@ class PurchaseOrderCancelSerializer(serializers.Serializer): class Meta: """Metaclass options.""" - fields = ([],) + fields = [] def get_context_data(self): """Return custom context information about the order.""" diff --git a/src/backend/InvenTree/order/test_api.py b/src/backend/InvenTree/order/test_api.py index fb59f8b446..6e875a8bf9 100644 --- a/src/backend/InvenTree/order/test_api.py +++ b/src/backend/InvenTree/order/test_api.py @@ -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)