Merge pull request #3725 from cisagov/es/3664-enable-subsequent-requests
Some checks failed
Testing / django-migrations-complete (push) Has been cancelled
Build and deploy development for release / deploy-development (push) Has been cancelled
Security checks / Django security check (push) Has been cancelled
Security checks / Ensure custom mods are contained (push) Has been cancelled
Security checks / OWASP security scan (push) Has been cancelled
Testing / python-linting (push) Has been cancelled
Testing / python-test (push) Has been cancelled
Testing / pa11y-scan (push) Has been cancelled

3664: Enable subsequent domain requests in org model [AG]
This commit is contained in:
Erin Song 2025-04-17 12:03:06 -04:00 committed by GitHub
commit 47b65aaecf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,6 +23,7 @@ from registrar.models.user import User
from registrar.utility.waffle import flag_is_active_for_user
from registrar.views.utility import StepsHelper
from registrar.utility.enums import Step, PortfolioDomainRequestStep
from registrar.views.utility.invitation_helper import get_org_membership
logger = logging.getLogger(__name__)
@ -326,7 +327,9 @@ class DomainRequestWizard(TemplateView):
# if pending requests exist and user does not have approved domains,
# present message that domain request cannot be submitted
pending_requests = self.pending_requests()
if len(pending_requests) > 0:
portfolio = self.request.session.get("portfolio")
_, member_of_this_org = get_org_membership(portfolio, self.request.user.email, self.request.user)
if not member_of_this_org and len(pending_requests) > 0:
message_header = "You cannot submit this request yet"
message_content = (
f"<h4 class='usa-alert__heading'>{message_header}</h4> "