fix - showing my devices
This commit is contained in:
@@ -113,12 +113,12 @@ class DeviceViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet, AdminFi
|
||||
organization = get_organization_by_user(request.user)
|
||||
devices = self.get_queryset(
|
||||
visibility_by_org_scope=True
|
||||
) if organization.free_visibility_by_scope else self.get_queryset()
|
||||
)
|
||||
|
||||
# filter by Jihad & admin of system
|
||||
if organization.type.key == 'J':
|
||||
queryset = devices.filter(assignment__client__organization__province=organization.province)
|
||||
elif not organization.type.key == 'ADM':
|
||||
elif organization.type.key == 'PSP':
|
||||
queryset = apply_visibility_filter_by_org_type(devices, organization)
|
||||
else:
|
||||
queryset = devices
|
||||
|
||||
Reference in New Issue
Block a user