import user

This commit is contained in:
caoqianming 2020-05-11 16:00:50 +08:00
parent d4004c7544
commit a8d3598288
1 changed files with 1 additions and 1 deletions

View File

@ -228,7 +228,7 @@ class ConsumerViewSet(ModelViewSet):
try:
workscopeobj = WorkScope.objects.get(name=workscope)
obj.workscope = workscopeobj
PaySubject.objects.create(subject=workscopeobj.subject, consumer = obj)
PaySubject.objects.get_or_create(subject=workscopeobj.subject, consumer = obj)
except:
return Response({"error":"工作类别不存在!"})
obj.save()