refector: norecord优化

This commit is contained in:
caoqianming 2023-06-01 14:11:22 +08:00
parent 2595a51390
commit b6ca08a3f0
1 changed files with 2 additions and 0 deletions

View File

@ -524,6 +524,8 @@ class Task2DoViewSet(ListModelMixin, GenericViewSet):
obj = self.get_object()
field = request.data.get('key')
theattr = getattr(obj, field, None)
if theattr == 0:
return Response()
if theattr is None:
setattr(obj, field, 0)
if field == 'num_complaint':