mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
- Throwing an error on an OPTIONS request
(cherry picked from commit 758871b8a9
)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
parent
b57f53c4cf
commit
91c5843425
@ -271,7 +271,7 @@ class PurchaseOrderCancelSerializer(serializers.Serializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
"""Metaclass options."""
|
"""Metaclass options."""
|
||||||
|
|
||||||
fields = ([],)
|
fields = []
|
||||||
|
|
||||||
def get_context_data(self):
|
def get_context_data(self):
|
||||||
"""Return custom context information about the order."""
|
"""Return custom context information about the order."""
|
||||||
|
@ -484,6 +484,9 @@ class PurchaseOrderTest(OrderTest):
|
|||||||
|
|
||||||
url = reverse('api-po-cancel', kwargs={'pk': po.pk})
|
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
|
# Try to cancel the PO, but without required permissions
|
||||||
self.post(url, {}, expected_code=403)
|
self.post(url, {}, expected_code=403)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user