Adam Goldsmith
e14e57c39e
This primarily to make the list of members not block/slow down loading excessively, as it was currently doing
15 lines
375 B
Python
15 lines
375 B
Python
from dal import autocomplete
|
|
|
|
from .models import Member
|
|
|
|
|
|
class MemberAutocomplete(autocomplete.Select2QuerySetView):
|
|
model = Member
|
|
search_fields = ["account_name"]
|
|
|
|
def get_queryset(self):
|
|
if not self.request.user.has_perm("membershipworks.view_member"):
|
|
return Member.objects.none()
|
|
else:
|
|
return super().get_queryset()
|