mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 04:28:39 +02:00
Check that active user is org member when adding subsequent request
This commit is contained in:
parent
5db1f35e45
commit
1ea3dc0d15
1 changed files with 4 additions and 1 deletions
|
@ -23,6 +23,7 @@ from registrar.models.user import User
|
||||||
from registrar.utility.waffle import flag_is_active_for_user
|
from registrar.utility.waffle import flag_is_active_for_user
|
||||||
from registrar.views.utility import StepsHelper
|
from registrar.views.utility import StepsHelper
|
||||||
from registrar.utility.enums import Step, PortfolioDomainRequestStep
|
from registrar.utility.enums import Step, PortfolioDomainRequestStep
|
||||||
|
from registrar.views.utility.invitation_helper import get_org_membership
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -326,7 +327,9 @@ class DomainRequestWizard(TemplateView):
|
||||||
# if pending requests exist and user does not have approved domains,
|
# if pending requests exist and user does not have approved domains,
|
||||||
# present message that domain request cannot be submitted
|
# present message that domain request cannot be submitted
|
||||||
pending_requests = self.pending_requests()
|
pending_requests = self.pending_requests()
|
||||||
if not flag_is_active_for_user(self.request.user, "organization_feature") and 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_header = "You cannot submit this request yet"
|
||||||
message_content = (
|
message_content = (
|
||||||
f"<h4 class='usa-alert__heading'>{message_header}</h4> "
|
f"<h4 class='usa-alert__heading'>{message_header}</h4> "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue