Add logic

This commit is contained in:
zandercymatics 2024-07-31 11:02:18 -06:00
parent f9606ac43c
commit 280f7cbc1b
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
6 changed files with 11 additions and 2 deletions

View file

@ -424,3 +424,8 @@ class User(AbstractUser):
def is_org_user(self, request):
has_organization_feature_flag = flag_is_active(request, "organization_feature")
return has_organization_feature_flag and self.has_base_portfolio_permission()
def user_domain_count(self):
"""Returns the number of domains associated with this user through UserDomainRole"""
available_domains = UserDomainRole.objects.filter(user=self, domain__isnull=False)
return available_domains.count()