瀏覽代碼

fix: add get_object()

yobafromstarvvars 1 年之前
父節點
當前提交
c5c14211e5
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      apiviews/orders_local.py

+ 1 - 1
apiviews/orders_local.py

@@ -49,7 +49,7 @@ class OrdersLocalMVS(viewsets.ModelViewSet):
 
     def update(self, request, *args, **kwargs):
         partial = kwargs.pop('partial', False)
-        instance = OrdersLocal.objects.select_related('order_synced__ticket').get(id=1)
+        instance = self.get_object()# OrdersLocal.objects.select_related('order_synced__ticket').get(id=1)
         serializer = self.get_serializer(instance, data=request.data, partial=partial)
         # for serializer in serializers:
         serializer.is_valid(raise_exception=True)