diff --git a/src/registrar/models/user.py b/src/registrar/models/user.py index 5360bde77..00bdf7868 100644 --- a/src/registrar/models/user.py +++ b/src/registrar/models/user.py @@ -292,8 +292,6 @@ class User(AbstractUser): def is_org_user(self, request): has_organization_feature_flag = flag_is_active(request, "organization_feature") - user_portfolios = Portfolio.objects.filter(creator=self) - - user_portfolios_exist = user_portfolios.exists() + user_portfolios_exist = Portfolio.objects.filter(creator=self).exists() return has_organization_feature_flag and user_portfolios_exist diff --git a/src/registrar/templates/home.html b/src/registrar/templates/home.html index 4518db271..b79b69ebc 100644 --- a/src/registrar/templates/home.html +++ b/src/registrar/templates/home.html @@ -4,10 +4,6 @@ {% block title %} Home | {% endblock %} -{% comment %} - home and portfolio_base test for is_authenticated -{% endcomment %} - {% block content %}
{% if user.is_authenticated %} diff --git a/src/registrar/templates/portfolio_base.html b/src/registrar/templates/portfolio_base.html index d4ba4dab2..64653c74e 100644 --- a/src/registrar/templates/portfolio_base.html +++ b/src/registrar/templates/portfolio_base.html @@ -1,9 +1,5 @@ {% extends "base.html" %} -{% comment %} - home and portfolio_base test for is_authenticated -{% endcomment %} - {% block wrapper %}
{% block content %} diff --git a/src/registrar/views/domains_json.py b/src/registrar/views/domains_json.py index 59bc3e778..5fd947155 100644 --- a/src/registrar/views/domains_json.py +++ b/src/registrar/views/domains_json.py @@ -1,3 +1,4 @@ +import logging from django.http import JsonResponse from django.core.paginator import Paginator from registrar.models import UserDomainRole, Domain @@ -5,6 +6,8 @@ from django.contrib.auth.decorators import login_required from django.urls import reverse from django.db.models import Q +logger = logging.getLogger(__name__) + @login_required def get_domains_json(request): @@ -101,6 +104,7 @@ def serialize_domain(domain): suborganization_name = suborganization.name except Domain.domain_info.RelatedObjectDoesNotExist: domain_info = None + logger.debug(f'Issue in domains_json: We could not find domain_info for {domain}') return { "id": domain.id, diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index a2752168f..007bcdd47 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -7,8 +7,6 @@ def index(request): context = {} if request.user.is_authenticated: - context["has_organization_feature_flag"] = flag_is_active(request, "organization_feature") - # This controls the creation of a new domain request in the wizard request.session["new_request"] = True