mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-02 16:02:15 +02:00
Add basic flag
This commit is contained in:
parent
97d71246d9
commit
f52a7e08fe
4 changed files with 16 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue