perms_map bug

This commit is contained in:
曹前明 2022-07-04 16:13:27 +08:00
parent 2ec6f45525
commit 5e420e9428
2 changed files with 2 additions and 1 deletions

View File

@ -63,6 +63,7 @@ class EventViewSet(ListModelMixin, RetrieveModelMixin, CustomGenericViewSet):
serializer_class = EventSerializer
select_related_fields = ['area', 'employee', 'handle_user']
prefetch_related_fields = ['cates']
filterset_fields = ['cates']
@transaction.atomic
@action(methods=['post'], detail=True, perms_map={'post': 'event:handle'},

View File

@ -20,7 +20,7 @@ def get_user_perms_map(user):
objs = UserPost.objects.filter(user=user)
for i in objs:
dept_id = str(i.dept.id)
for pr in PostRole.objects.filter(post=i.post).exists():
for pr in PostRole.objects.filter(post=i.post):
"""
岗位角色
"""