diff --git a/apps/core/api.py b/apps/core/api.py index 3479589..8808827 100644 --- a/apps/core/api.py +++ b/apps/core/api.py @@ -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) diff --git a/logs/django_requests.log b/logs/django_requests.log index 5de3ba7..dc71c9b 100644 --- a/logs/django_requests.log +++ b/logs/django_requests.log @@ -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.