fix(users): add include_all param to UserListView for contributor search

Superusers (admins) were excluded by the is_superuser=False filter,
making them unsearchable in the contributor picker. Pass include_all=1
to bypass this filter when searching for event contributors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-03 17:41:45 +05:30
parent 7913f9f8e9
commit 0b2050443b

View File

@@ -585,7 +585,8 @@ class UserListView(APIView):
from django.contrib.auth import get_user_model
from django.db.models import Q
User = get_user_model()
qs = User.objects.filter(is_superuser=False)
include_all = request.query_params.get('include_all', '0') == '1'
qs = User.objects.all() if include_all else User.objects.filter(is_superuser=False)
# Server-side search
search = request.query_params.get('search', '').strip()