Merge branch 'master' of https://e.coding.net/ctcdevteam/cma_search
This commit is contained in:
commit
fb8bd5e2bb
|
|
@ -522,9 +522,16 @@ class Task2DoViewSet(ListModelMixin, GenericViewSet):
|
||||||
没有记录
|
没有记录
|
||||||
"""
|
"""
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
theattr = getattr(obj, request.data.get('key'), None)
|
field = request.data.get('key')
|
||||||
|
theattr = getattr(obj, field, None)
|
||||||
|
if theattr == 0:
|
||||||
|
return Response()
|
||||||
if theattr is None:
|
if theattr is None:
|
||||||
theattr = 0
|
setattr(obj, field, 0)
|
||||||
|
if field == 'num_complaint':
|
||||||
|
obj.num_complaint_10 = 0
|
||||||
|
elif field == 'num_pt':
|
||||||
|
obj.num_pt_10 = 0
|
||||||
else:
|
else:
|
||||||
raise ParseError('已有记录')
|
raise ParseError('已有记录')
|
||||||
obj.save()
|
obj.save()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue