From bb92330a6951c014d9226116b01da50b6c466ae5 Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:09:56 -0500 Subject: [PATCH 01/14] updated readme --- src/registrar/views/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index 7019c8db3..ecdbf2702 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -8,5 +8,5 @@ def index(request): if request and request.user and request.user.is_authenticated: # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() - + return render(request, "home.html", context) From cb117c2f5a0b71b80ccbd9c85ae7a3ecffb56066 Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:12:36 -0500 Subject: [PATCH 02/14] changes --- docs/developer/adding-feature-flags.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/developer/adding-feature-flags.md b/docs/developer/adding-feature-flags.md index dc51b9e85..c4e6eda89 100644 --- a/docs/developer/adding-feature-flags.md +++ b/docs/developer/adding-feature-flags.md @@ -16,6 +16,14 @@ We use [django-waffle](https://waffle.readthedocs.io/en/stable/) for our feature 4. (Important) Set the field `Everyone` to `Unknown`. This field overrides all other settings when set to anything else. 5. Configure the settings as you see fit. +## Enabling a feature flag with portfolio permissions +1. Go to file `context_processors.py` +2. Add feature flag name to the `porfolio_context` within the `portfolio_permissions` method. +3. For the conditional under `if portfolio`, add the feature flag name, and assign the appropiate permission that are in the `user.py` model. + +#### Note: +- If your use case includes non org, you want to add a feature flag outside of it, you can just update the portfolio context outside of the if statement. + ## Using feature flags as boolean values Waffle [provides a boolean](https://waffle.readthedocs.io/en/stable/usage/views.html) called `flag_is_active` that you can use as you otherwise would a boolean. This boolean requires a request object and the flag name. From b4c41377cd48056a4125c07c66cc783def23e2e8 Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:16:41 -0500 Subject: [PATCH 03/14] removed space --- src/registrar/views/index.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index ecdbf2702..4d17a3ea5 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -8,5 +8,4 @@ def index(request): if request and request.user and request.user.is_authenticated: # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() - return render(request, "home.html", context) From 41146f9d1b9c206737a4c44861b8aa951cef5286 Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:17:12 -0500 Subject: [PATCH 04/14] adding space --- src/registrar/views/index.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index 4d17a3ea5..030d6b162 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -8,4 +8,5 @@ def index(request): if request and request.user and request.user.is_authenticated: # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() + return render(request, "home.html", context) From 53f4640dc6aa044ec3d31eb06221f5ecffbed92d Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:19:48 -0500 Subject: [PATCH 05/14] edited space --- src/registrar/views/index.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index 030d6b162..853794028 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -9,4 +9,5 @@ def index(request): # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() + return render(request, "home.html", context) From c983d621993883b5f56ba67416d31df799a6e9bc Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:20:24 -0500 Subject: [PATCH 06/14] added a space accidentally and removed it --- src/registrar/views/index.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index 853794028..030d6b162 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -9,5 +9,4 @@ def index(request): # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() - return render(request, "home.html", context) From ff0aaf082ae55549a0c06b9068b370bde6e56cfd Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:20:52 -0500 Subject: [PATCH 07/14] fixed the space finally --- src/registrar/views/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index 030d6b162..ecdbf2702 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -8,5 +8,5 @@ def index(request): if request and request.user and request.user.is_authenticated: # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() - + return render(request, "home.html", context) From 60f2d0269d620f4523616d7393eff2abaac8db96 Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:21:17 -0500 Subject: [PATCH 08/14] fixed the space finally --- src/registrar/views/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index ecdbf2702..030d6b162 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -8,5 +8,5 @@ def index(request): if request and request.user and request.user.is_authenticated: # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() - + return render(request, "home.html", context) From 1671117a28967ace7ebe71b7ba24b8292d5abd9f Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:21:52 -0500 Subject: [PATCH 09/14] fixed the space finally III --- src/registrar/views/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index 030d6b162..aee3c4ef0 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -8,5 +8,5 @@ def index(request): if request and request.user and request.user.is_authenticated: # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() - + return render(request, "home.html", context) From ef73f00dbca89dc0ce06567a9fd07905ba816834 Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:22:23 -0500 Subject: [PATCH 10/14] fixed the space finally IV --- src/registrar/views/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index aee3c4ef0..a3b685203 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -8,5 +8,5 @@ def index(request): if request and request.user and request.user.is_authenticated: # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() - + return render(request, "home.html", context) From 516cac8a5ffb8d3364e3136c03275cf4ccd1cbe2 Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:22:43 -0500 Subject: [PATCH 11/14] fixed the space finally VI --- src/registrar/views/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index a3b685203..030d6b162 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -8,5 +8,5 @@ def index(request): if request and request.user and request.user.is_authenticated: # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() - + return render(request, "home.html", context) From 78cc8e345af53ff070b6f49cbc88fb5036147d86 Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:24:23 -0500 Subject: [PATCH 12/14] this will fix it --- src/registrar/views/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index 030d6b162..01ca2d1d0 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -8,5 +8,5 @@ def index(request): if request and request.user and request.user.is_authenticated: # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() - + return render(request, "home.html", context) From 3069f696442fc5b2ef9f27a598123b10322b2df9 Mon Sep 17 00:00:00 2001 From: asaki222 Date: Thu, 5 Dec 2024 13:24:57 -0500 Subject: [PATCH 13/14] this will fix it again --- src/registrar/views/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index 01ca2d1d0..7019c8db3 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -8,5 +8,5 @@ def index(request): if request and request.user and request.user.is_authenticated: # This controls the creation of a new domain request in the wizard context["user_domain_count"] = request.user.get_user_domain_ids(request).count() - + return render(request, "home.html", context) From f8dd683a5f4a219c3b65abc0a031d18421466297 Mon Sep 17 00:00:00 2001 From: asaki222 Date: Tue, 10 Dec 2024 16:24:16 -0500 Subject: [PATCH 14/14] removed a todo to trigger linters/tests/checks --- src/registrar/management/commands/master_domain_migrations.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/registrar/management/commands/master_domain_migrations.py b/src/registrar/management/commands/master_domain_migrations.py index 9cb469078..7f702e047 100644 --- a/src/registrar/management/commands/master_domain_migrations.py +++ b/src/registrar/management/commands/master_domain_migrations.py @@ -29,9 +29,6 @@ logger = logging.getLogger(__name__) class Command(BaseCommand): help = """ """ # TODO: update this! - # ====================================================== - # ================== ARGUMENTS =================== - # ====================================================== def add_arguments(self, parser): """ OPTIONAL ARGUMENTS: