mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Remove 'draft' function from StockItem RUD endpoint
This commit is contained in:
parent
9ae5ea3876
commit
6c3041d99c
@ -22,15 +22,3 @@ class UserSerializerBrief(serializers.ModelSerializer):
|
|||||||
'pk',
|
'pk',
|
||||||
'username',
|
'username',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class DraftRUDView(generics.RetrieveAPIView, generics.UpdateAPIView, generics.DestroyAPIView):
|
|
||||||
|
|
||||||
def perform_update(self, serializer):
|
|
||||||
|
|
||||||
ctx_data = serializer._context['request'].data
|
|
||||||
|
|
||||||
if ctx_data.get('_is_final', False) in [True, u'true', u'True', 1]:
|
|
||||||
super(generics.UpdateAPIView, self).perform_update(serializer)
|
|
||||||
else:
|
|
||||||
pass
|
|
||||||
|
@ -13,7 +13,6 @@ from .serializers import LocationSerializer
|
|||||||
from .serializers import StockTrackingSerializer
|
from .serializers import StockTrackingSerializer
|
||||||
|
|
||||||
from InvenTree.views import TreeSerializer
|
from InvenTree.views import TreeSerializer
|
||||||
from InvenTree.serializers import DraftRUDView
|
|
||||||
|
|
||||||
from rest_framework.serializers import ValidationError
|
from rest_framework.serializers import ValidationError
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
@ -26,7 +25,7 @@ class StockCategoryTree(TreeSerializer):
|
|||||||
model = StockLocation
|
model = StockLocation
|
||||||
|
|
||||||
|
|
||||||
class StockDetail(DraftRUDView):
|
class StockDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
get:
|
get:
|
||||||
|
Loading…
Reference in New Issue
Block a user