ecm handle 权限去除

This commit is contained in:
曹前明 2022-07-06 18:45:22 +08:00
parent 8d9f458cd7
commit adde4d671e
1 changed files with 6 additions and 4 deletions

View File

@ -44,10 +44,12 @@ class AlgoChannelViewSet(CreateModelMixin, DestroyModelMixin, ListModelMixin, Cu
serializer = AlgoChannelCreatesSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
vdata = serializer.validated_data
acs = []
for i in vdata['vchannels']:
acs.append(AlgoChannel(id=idWorker.get_id(), algo=vdata['algo'], vchannel=i))
AlgoChannel.objects.bulk_create(objs=acs, ignore_conflicts=True)
AlgoChannel.objects.get_or_create(algo=vdata['algo'], vchannel=i,
defaults={
"algo": vdata['algo'],
"vchannel": i
})
return Response()
@ -66,7 +68,7 @@ class EventViewSet(ListModelMixin, RetrieveModelMixin, CustomGenericViewSet):
filterset_fields = ['cates']
@transaction.atomic
@action(methods=['post'], detail=True, perms_map={'post': 'event:handle'},
@action(methods=['post'], detail=True, perms_map={'post': '*'},
serializer_class=EventHandleSerializer)
def handle(self, request, pk=None):
"""处理事件