Update domains_json to reflect the correct data

This commit is contained in:
zandercymatics 2024-07-31 12:15:14 -06:00
parent 117c7e0c42
commit 3fafaf2d2a
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -14,8 +14,7 @@ def get_domains_json(request):
"""Given the current request, """Given the current request,
get all domains that are associated with the UserDomainRole object""" get all domains that are associated with the UserDomainRole object"""
user_domain_roles = UserDomainRole.objects.filter(user=request.user).select_related("domain_info__sub_organization") domain_ids = request.user.get_user_domain_ids()
domain_ids = user_domain_roles.values_list("domain_id", flat=True)
objects = Domain.objects.filter(id__in=domain_ids) objects = Domain.objects.filter(id__in=domain_ids)
unfiltered_total = objects.count() unfiltered_total = objects.count()