feat: norecord时num_pt_10 也为0
This commit is contained in:
parent
f5e237b635
commit
a7d2c4f8c4
|
|
@ -522,9 +522,14 @@ class Task2DoViewSet(ListModelMixin, GenericViewSet):
|
|||
没有记录
|
||||
"""
|
||||
obj = self.get_object()
|
||||
theattr = getattr(obj, request.data.get('key'), None)
|
||||
field = request.data.get('key')
|
||||
theattr = getattr(obj, field, None)
|
||||
if theattr is None:
|
||||
theattr = 0
|
||||
if field == 'num_complaint':
|
||||
obj.num_complaint_10 = 0
|
||||
elif field == 'num_pt':
|
||||
obj.num_pt_10 = 0
|
||||
else:
|
||||
raise ParseError('已有记录')
|
||||
obj.save()
|
||||
|
|
|
|||
Loading…
Reference in New Issue