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