refector: norecord优化
This commit is contained in:
parent
2595a51390
commit
b6ca08a3f0
|
|
@ -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':
|
||||
|
|
|
|||
Loading…
Reference in New Issue