From b92921678ce25b643a508d07649d2ac3fce5af7d Mon Sep 17 00:00:00 2001 From: Kevin Carrogan Date: Tue, 21 Jan 2025 15:20:50 +0000 Subject: [PATCH] Add F680 question to initial apply flow --- conf/base.py | 2 ++ exporter/apply_for_a_licence/forms/triage_questions.py | 8 ++++++++ exporter/apply_for_a_licence/urls.py | 5 +++++ exporter/apply_for_a_licence/views.py | 10 +++++++++- exporter/f680/__init__.py | 0 exporter/f680/urls.py | 10 ++++++++++ exporter/f680/views.py | 7 +++++++ exporter/urls.py | 5 +++++ 8 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 exporter/f680/__init__.py create mode 100644 exporter/f680/urls.py create mode 100644 exporter/f680/views.py diff --git a/conf/base.py b/conf/base.py index ded6f4d022..4fd674fe81 100644 --- a/conf/base.py +++ b/conf/base.py @@ -352,3 +352,5 @@ def show_toolbar(request): GTM_ID = env.str("GTM_ID", default="") GIT_COMMIT = env.str("GIT_COMMIT", default="") + +FEATURE_FLAG_F680 = env.bool("FEATURE_FLAG_F680", default=False) diff --git a/exporter/apply_for_a_licence/forms/triage_questions.py b/exporter/apply_for_a_licence/forms/triage_questions.py index ca59916011..2f61bd26b0 100644 --- a/exporter/apply_for_a_licence/forms/triage_questions.py +++ b/exporter/apply_for_a_licence/forms/triage_questions.py @@ -34,6 +34,14 @@ def opening_question(): "before you provide access to controlled technology, software or data." ), ), + Option( + key="f680", + value="MOD F680", + description=( + "Select if you need approval to release security classified products or information to foreign entities." + ), + disabled=not settings.FEATURE_FLAG_F680, + ), Option( key="transhipment", value="Transhipment licence", diff --git a/exporter/apply_for_a_licence/urls.py b/exporter/apply_for_a_licence/urls.py index 4c6d51edf2..87bd61eb36 100644 --- a/exporter/apply_for_a_licence/urls.py +++ b/exporter/apply_for_a_licence/urls.py @@ -11,6 +11,11 @@ path("export/", views.ExportLicenceQuestions.as_view(), name="export_licence_questions"), ] +if settings.FEATURE_FLAG_F680: + urlpatterns += [ + path("f680/", views.F680Questions.as_view(), name="f680_questions"), # /PS-IGNORE + ] + if not settings.FEATURE_FLAG_ONLY_ALLOW_SIEL: urlpatterns += [ path("transhipment/", views.TranshipmentQuestions.as_view(), name="transhipment_questions"), diff --git a/exporter/apply_for_a_licence/views.py b/exporter/apply_for_a_licence/views.py index bf71d3098d..9ea5892802 100644 --- a/exporter/apply_for_a_licence/views.py +++ b/exporter/apply_for_a_licence/views.py @@ -1,5 +1,8 @@ from django.urls import reverse_lazy, reverse -from django.views.generic import TemplateView +from django.views.generic import ( + RedirectView, + TemplateView, +) from exporter.applications.services import post_applications, post_open_general_licences_applications from exporter.apply_for_a_licence.forms.open_general_licences import ( @@ -101,3 +104,8 @@ def get_success_url(self): class OpenGeneralLicenceSubmit(LoginRequiredMixin, TemplateView): def get(self, request, *args, **kwargs): return open_general_licence_submit_success_page(request, **kwargs) + + +class F680Questions(LoginRequiredMixin, RedirectView): # /PS-IGNORE + def get_redirect_url(self, *args, **kwargs): + return reverse("f680:apply") diff --git a/exporter/f680/__init__.py b/exporter/f680/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/exporter/f680/urls.py b/exporter/f680/urls.py new file mode 100644 index 0000000000..4b1d105d7b --- /dev/null +++ b/exporter/f680/urls.py @@ -0,0 +1,10 @@ +from django.urls import path + +from . import views + + +app_name = "f680" + +urlpatterns = [ + path("apply/", views.ApplyView.as_view(), name="apply"), +] diff --git a/exporter/f680/views.py b/exporter/f680/views.py new file mode 100644 index 0000000000..111ad34e04 --- /dev/null +++ b/exporter/f680/views.py @@ -0,0 +1,7 @@ +from django.http import HttpResponse +from django.views import View + + +class ApplyView(View): + def get(self, request, *args, **kwargs): + return HttpResponse("OK") diff --git a/exporter/urls.py b/exporter/urls.py index f4b3387653..e65c944ba3 100644 --- a/exporter/urls.py +++ b/exporter/urls.py @@ -53,3 +53,8 @@ urlpatterns = [ path("__debug__/", include(debug_toolbar.urls)), ] + urlpatterns + +if settings.FEATURE_FLAG_F680: + urlpatterns += [ + path("f680/", include("exporter.f680.urls")), + ]