Add basic flag

This commit is contained in:
zandercymatics 2024-04-30 09:28:11 -06:00
parent 97d71246d9
commit f52a7e08fe
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
4 changed files with 16 additions and 3 deletions

View file

@ -323,6 +323,13 @@ EMAIL_TIMEOUT = 30
SERVER_EMAIL = "root@get.gov"
# endregion
# region: Waffle feature flags-----------------------------------------------------------###
# If Waffle encounters a reference to a flag that is not in the database, should Waffle create the flag?
# WAFFLE_CREATE_MISSING_FLAGS
# endregion
# region: Headers-----------------------------------------------------------###
# Content-Security-Policy configuration

View file

@ -72,6 +72,9 @@
{% if not IS_PRODUCTION %}
{% include "includes/non-production-alert.html" %}
{% if profile_feature_flag %}
<h2>it worked!</h2>
{% endif %}
{% endif %}
<section class="usa-banner" aria-label="Official website of the United States government">

View file

@ -1,5 +1,4 @@
<div class="usa-site-alert--emergency margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert"
>
<div class="usa-site-alert--emergency margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert">
<div class="usa-alert">
<div class="usa-alert__body {% if add_body_class %}{{ add_body_class }}{% endif %}">
<b>Attention:</b> You are on a test site.

View file

@ -1,7 +1,7 @@
from django.shortcuts import render
from registrar.models import DomainRequest, Domain, UserDomainRole
from waffle.decorators import flag_is_active
def index(request):
"""This page is available to anyone without logging in."""
@ -20,6 +20,10 @@ def index(request):
has_deletable_domain_requests = deletable_domain_requests.exists()
context["has_deletable_domain_requests"] = has_deletable_domain_requests
# This is a django waffle flag which toggles features based off of the "flag" table
# TODO - note that the flag must be checked for superuser AND staff for superuser to see it
context["profile_feature_flag"] = flag_is_active(request, "profile_feature")
# If they can delete domain requests, add the delete button to the context
if has_deletable_domain_requests:
# Add the delete modal button to the context