Merge branch 'master' of https://e.coding.net/ctcdevteam/cma_search
This commit is contained in:
commit
8d8d6f472d
|
@ -127,6 +127,16 @@ class RecordViewSet(RbacFilterSet, PageOrNot, CreateUpdateCustomMixin, ModelView
|
|||
instance.save()
|
||||
return Response(status=status.HTTP_200_OK)
|
||||
|
||||
@action(methods=['post'], detail=True, perms_map = {'post':'record_up'})
|
||||
def createself(self, request, *args, **kwargs):
|
||||
contents = request.data['contents']
|
||||
rlist = []
|
||||
for i in contents:
|
||||
data = {'content':Content.objects.get(pk=i), 'belong_dept':request.user.dept, 'is_self':True}
|
||||
rlist.append(Record(**data))
|
||||
Record.objects.bulk_create(rlist)
|
||||
return Response(status=status.HTTP_200_OK)
|
||||
|
||||
@action(methods=['put'], detail=True, perms_map = {'post':'record_up'})
|
||||
def up(self, request, *args, **kwargs):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue