Skip to content

Commit

Permalink
Merge pull request #2533 from cisagov/dk/2379-hotfix
Browse files Browse the repository at this point in the history
Issue #2379: Hotfix for portfolio waffle flag not being checked in all templates
  • Loading branch information
dave-kennedy-ecs authored Aug 2, 2024
2 parents 60e48f5 + 77c1673 commit 5bbd533
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/registrar/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def add_has_profile_feature_flag_to_context(request):
def portfolio_permissions(request):
"""Make portfolio permissions for the request user available in global context"""
try:
if not request.user or not request.user.is_authenticated:
if not request.user or not request.user.is_authenticated or not flag_is_active(request, "organization_feature"):
return {
"has_base_portfolio_permission": False,
"has_domains_portfolio_permission": False,
Expand All @@ -74,7 +74,7 @@ def portfolio_permissions(request):
"has_domains_portfolio_permission": request.user.has_domains_portfolio_permission(),
"has_domain_requests_portfolio_permission": request.user.has_domain_requests_portfolio_permission(),
"portfolio": request.user.portfolio,
"has_organization_feature_flag": flag_is_active(request, "organization_feature"),
"has_organization_feature_flag": True,
}
except AttributeError:
# Handles cases where request.user might not exist
Expand Down

0 comments on commit 5bbd533

Please sign in to comment.