This commit is contained in:
Rachid Mrad 2024-07-16 19:16:57 -04:00
parent 2ec3fa774d
commit 58957e1250
No known key found for this signature in database
5 changed files with 5 additions and 13 deletions

View file

@ -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

View file

@ -4,10 +4,6 @@
{% block title %} Home | {% endblock %}
{% comment %}
home and portfolio_base test for is_authenticated
{% endcomment %}
{% block content %}
<main id="main-content" class="grid-container">
{% if user.is_authenticated %}

View file

@ -1,9 +1,5 @@
{% extends "base.html" %}
{% comment %}
home and portfolio_base test for is_authenticated
{% endcomment %}
{% block wrapper %}
<div id="wrapper">
{% block content %}

View file

@ -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,

View file

@ -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