dont show admin (BaseViewSet)

This commit is contained in:
2025-10-27 15:41:37 +03:30
parent 14d30956b9
commit caf11802f7
2 changed files with 2 additions and 1 deletions

View File

@@ -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)

View File

@@ -22,3 +22,4 @@
[2025-10-27 14:42:18,042] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
[2025-10-27 14:46:25,256] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\api\v1\serializers\serializer.py changed, reloading.
[2025-10-27 14:46:27,085] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
[2025-10-27 15:36:00,646] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\core\api.py changed, reloading.