fix - transaction & show users with my organization except me
This commit is contained in:
@@ -36,7 +36,9 @@ class BaseViewSet(RegionFilterMixin, viewsets.ModelViewSet):
|
||||
model_name = queryset.model.__name__.lower()
|
||||
|
||||
if model_name == 'userrelations': # noqa
|
||||
queryset = (queryset.filter(organization__in=child_orgs))
|
||||
# add all users with my organization except my user
|
||||
child_orgs.append(org)
|
||||
queryset = (queryset.filter(organization__in=child_orgs).exclude(user=user))
|
||||
|
||||
elif model_name == 'organization':
|
||||
queryset = queryset.filter(id__in=[org.id for org in child_orgs])
|
||||
|
||||
Reference in New Issue
Block a user