dont show admin (BaseViewSet)
This commit is contained in:
@@ -27,7 +27,7 @@ class BaseViewSet(RegionFilterMixin, viewsets.ModelViewSet):
|
||||
model_name = queryset.model.__name__.lower()
|
||||
|
||||
if model_name == 'userrelations': # noqa
|
||||
queryset = queryset.exclude(id=user_relation.first().id)
|
||||
queryset = (queryset.exclude(id=user_relation.first().id)).exclude(role__type__key='ADM')
|
||||
|
||||
elif model_name == 'organization':
|
||||
queryset = queryset.exclude(id=user_relation.first().organization.id)
|
||||
|
||||
Reference in New Issue
Block a user