Skip to content

Commit

Permalink
PC-487: Add new British Gas unavailable screen
Browse files Browse the repository at this point in the history
  • Loading branch information
chidin194 committed Sep 18, 2023
1 parent 6d13d1e commit 14dcdd3
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 140 deletions.
3 changes: 3 additions & 0 deletions help_to_heat/frontdoor/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
extra_pages = (
"applications-closed",
"application-closed-utility-warehouse",
"application-closed-british-gas",
"address-select",
"address-manual",
"loft-access",
Expand All @@ -53,6 +54,7 @@
"utility-warehouse-warning-page": {"prev": "supplier", "next": "own-property"},
"applications-closed": {"prev": "supplier", "next": None},
"application-closed-utility-warehouse": {"prev": "supplier", "next": None},
"application-closed-british-gas": {"prev": "supplier", "next": None},
"benefits": {"prev": "council-tax-band", "next": "household-income"},
}

Expand Down Expand Up @@ -90,6 +92,7 @@
"utility-warehouse-warning-page": ("utility-warehouse-warning-page",),
"applications-closed": ("applications-closed",),
"application-closed-utility-warehouse": ("application-closed-utility-warehouse",),
"application-closed-british-gas": ("application-closed-british-gas",),
"own-property": ("own_property",),
"address": ("address",),
"council-tax-band": ("council_tax_band",),
Expand Down
13 changes: 10 additions & 3 deletions help_to_heat/frontdoor/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def unavailable_supplier_redirect(session_id):
if supplier == "Utility Warehouse":
next_page_name = "application-closed-utility-warehouse"
else:
next_page_name = "applications-closed"
next_page_name = "application-closed-british-gas"
return redirect("frontdoor:page", session_id=session_id, page_name=next_page_name)


Expand Down Expand Up @@ -539,8 +539,8 @@ def handle_post(self, request, session_id, page_name, data, is_change_page):
request_supplier = request_data.get("supplier")
if request_supplier == "Bulb, now part of Octopus Energy":
next_page_name = "bulb-warning-page"
if request_supplier in unavailable_suppliers:
next_page_name = "applications-closed"
if request_supplier == "British Gas":
next_page_name = "application-closed-british-gas"
if request_supplier == "Utility Warehouse":
next_page_name = "application-closed-utility-warehouse"

Expand Down Expand Up @@ -574,6 +574,13 @@ def get_context(self, session_id, *args, **kwargs):
return {"supplier": supplier}


@register_page("application-closed-british-gas")
class ApplicationsClosedBritishGasView(PageView):
def get_context(self, session_id, *args, **kwargs):
supplier = SupplierConverter(session_id).get_supplier_on_general_pages()
return {"supplier": supplier}


@register_page("contact-details")
class ContactDetailsView(PageView):
def get_context(self, session_id, *args, **kwargs):
Expand Down
Binary file modified help_to_heat/locale/cy/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit 14dcdd3

Please sign in to comment.