dont show admin (BaseViewSet)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user