Forráskód Böngészése

增加用户日志

yf_yzl 2 éve
szülő
commit
880368f702
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      smartfarming/views/home_land.py

+ 1 - 1
smartfarming/views/home_land.py

@@ -246,7 +246,7 @@ class MongoPlantInfoUpdateAPIView(APIView):
         plantname = request_data.get("plantname")
         pickcode = request_data.get("pickcode")
         planttype = request_data.get("planttype")
-        plan = MongoPlantInfo.objects.filter(plantname=plantname, planttype=planttype)
+        plan = MongoPlantInfo.objects.filter(plantname=plantname, planttype=planttype).exclude(id=plan_id)
         if plan:
             return Response({"code": 2, "msg": "该作物种类已存在,请核查"})
         MongoPlantInfo.objects.filter(id=plan_id).update(