fix-my devices - import new mixin of visible orgs

This commit is contained in:
2025-11-02 17:10:56 +03:30
parent 6a4cb0f618
commit 9fb0292817
2 changed files with 5 additions and 1 deletions

View File

@@ -99,7 +99,9 @@ class DeviceViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet, AdminFi
# using admin filter mixin to get query
devices = self.get_query(self.get_queryset(
visibility_by_org_scope=True
) if organization.free_visibility_by_scope else self.get_queryset())
) if organization.free_visibility_by_scope else self.get_queryset().filter(
organization=organization
))
# paginate devices
page = self.paginate_queryset(devices)

View File

@@ -694,3 +694,5 @@ AssertionError: .validate() should return the validated data
[2025-11-02 16:38:11,296] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\web\api\v1\viewsets\product_api.py changed, reloading.
[2025-11-02 16:38:16,320] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
[2025-11-02 17:05:50,482] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\web\api\v1\viewsets\device.py changed, reloading.
[2025-11-02 17:05:54,363] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
[2025-11-02 17:10:53,634] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\web\api\v1\viewsets\device.py changed, reloading.