Skip to content

Commit

Permalink
Merge pull request #399 from UKGovernmentBEIS/PC-1423-Q3-Scottish-EPC…
Browse files Browse the repository at this point in the history
…-Data-Dump

PC-1423: Q3 Scottish Data Dump
  • Loading branch information
Glenn-Clarke authored Nov 18, 2024
2 parents 25ccbfc + a6a078f commit 33bfdcf
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 29 deletions.
18 changes: 12 additions & 6 deletions help_to_heat/frontdoor/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,16 +887,19 @@ def build_extra_context(self, request, session_id, page_name, data, is_change_pa
gds_epc_date = None

current_month, next_month = utils.get_current_and_next_month_names(month_names)
current_quarter_month, next_quarter_month = utils.get_current_and_next_quarter_month_names(month_names)
(
scottish_epc_cutoff_month,
next_scottish_dump_month,
) = utils.get_current_scottish_epc_cutoff_and_next_dump_month_names(month_names)

context = {
"epc_rating": epc_band.upper() if epc_band else "",
"gds_epc_date": gds_epc_date,
"epc_date": epc_date,
"current_month": current_month,
"next_month": next_month,
"current_quarter_month": current_quarter_month,
"next_quarter_month": next_quarter_month,
"scottish_epc_cutoff_month": scottish_epc_cutoff_month,
"next_scottish_dump_month": next_scottish_dump_month,
"property_type": property_type,
"epc_display_options": schemas.epc_display_options_map,
"address": address,
Expand All @@ -921,15 +924,18 @@ def build_extra_context(self, request, session_id, page_name, data, is_change_pa
country = session_data.get(country_field)

current_month, next_month = utils.get_current_and_next_month_names(month_names)
current_quarter_month, next_quarter_month = utils.get_current_and_next_quarter_month_names(month_names)
(
scottish_epc_cutoff_month,
next_scottish_dump_month,
) = utils.get_current_scottish_epc_cutoff_and_next_dump_month_names(month_names)

show_month_wording = country in [country_field_england, country_field_wales]

return {
"current_month": current_month,
"next_month": next_month,
"current_quarter_month": current_quarter_month,
"next_quarter_month": next_quarter_month,
"scottish_epc_cutoff_month": scottish_epc_cutoff_month,
"next_scottish_dump_month": next_scottish_dump_month,
"show_month_wording": show_month_wording,
}

Expand Down
Binary file modified help_to_heat/locale/cy/LC_MESSAGES/django.mo
Binary file not shown.
29 changes: 15 additions & 14 deletions help_to_heat/locale/cy/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-14 10:27+0000\n"
"POT-Creation-Date: 2024-11-15 17:05+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -1577,17 +1577,18 @@ msgstr ""
#: help_to_heat/templates/frontdoor/epc.html:26
#, python-format
msgid ""
"If your property has had a new EPC issued since 1 %(current_quarter_month)s, "
"we may not be able to find it in our database because it is only updated "
"quarterly. If you do not recognise the EPC below as your most recent one, "
"please return to this service after 1 %(next_quarter_month)s when we expect "
"the database to have been updated."
"If your property has had a new EPC issued since 1 "
"%(scottish_epc_cutoff_month)s, we may not be able to find it in our database "
"because it is only updated quarterly. If you do not recognise the EPC below "
"as your most recent one, please return to this service after 1 "
"%(next_scottish_dump_month)s when we expect the database to have been "
"updated."
msgstr ""
"Os oes EPC newydd wedi'i rhoi i’ch eiddo chi ers 1 "
"%(current_quarter_month)s, efallai na fyddwn yn gallu dod o hyd iddi yn ein "
"%(scottish_epc_cutoff_month)s, efallai na fyddwn yn gallu dod o hyd iddi yn ein "
"cronfa ddata am mai dim ond bob chwarter y bydd honno’n cael ei diweddaru. "
"Os nad ydych chi’n adnabod yr EPC isod fel eich un ddiweddaraf chi, dewch yn "
"ôl i'r gwasanaeth yma ar ôl 1 %(next_quarter_month)s pan ydyn ni’n disgwyl y "
"ôl i'r gwasanaeth yma ar ôl 1 %(next_scottish_dump_month)s pan ydyn ni’n disgwyl y "
"bydd y gronfa ddata wedi'i diweddaru."

#: help_to_heat/templates/frontdoor/epc.html:29
Expand Down Expand Up @@ -2114,15 +2115,15 @@ msgstr ""
#: help_to_heat/templates/frontdoor/no-epc.html:24
#, python-format
msgid ""
"If your property was issued an EPC since 1 %(current_quarter_month)s, we may "
"not be able to find it in our database because it is updated quarterly. "
"Please return to this service after 1 %(next_quarter_month)s when we expect "
"the database to have been updated."
"If your property was issued an EPC since 1 %(scottish_epc_cutoff_month)s, we "
"may not be able to find it in our database because it is updated quarterly. "
"Please return to this service after 1 %(next_scottish_dump_month)s when we "
"expect the database to have been updated."
msgstr ""
"Os yw’ch eiddo wedi cael EPC ers 1 %(current_quarter_month)s, efallai na "
"Os yw’ch eiddo wedi cael EPC ers 1 %(scottish_epc_cutoff_month)s, efallai na "
"fyddwn yn gallu dod o hyd iddi yn ein cronfa ddata am mai bob chwarter y "
"bydd honno’n cael ei diweddaru. Dewch yn ôl i’r gwasanaeth yma ar ôl 1 "
"%(next_quarter_month)s pan ydyn ni’n disgwyl y bydd y gronfa ddata wedi'i "
"%(next_scottish_dump_month)s pan ydyn ni’n disgwyl y bydd y gronfa ddata wedi'i "
"diweddaru."

#: help_to_heat/templates/frontdoor/no-epc.html:27
Expand Down
2 changes: 1 addition & 1 deletion help_to_heat/templates/frontdoor/epc.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1 class="govuk-heading-l">{{_("We found an Energy Performance Certificate that
{% if show_monthly_epc_update_details %}
{{_("If your property has had a new EPC issued since 1 %(current_month)s, we may not be able to find it in our database because it is only updated monthly. If you do not recognise the EPC below as your most recent one, please return to this service after 1 %(next_month)s when we expect the database to have been updated.") % { "current_month": current_month, "next_month": next_month }}}
{% else %}
{{_("If your property has had a new EPC issued since 1 %(current_quarter_month)s, we may not be able to find it in our database because it is only updated quarterly. If you do not recognise the EPC below as your most recent one, please return to this service after 1 %(next_quarter_month)s when we expect the database to have been updated.") % { "current_quarter_month": current_quarter_month, "next_quarter_month": next_quarter_month }}}
{{_("If your property has had a new EPC issued since 1 %(scottish_epc_cutoff_month)s, we may not be able to find it in our database because it is only updated quarterly. If you do not recognise the EPC below as your most recent one, please return to this service after 1 %(next_scottish_dump_month)s when we expect the database to have been updated.") % { "scottish_epc_cutoff_month": scottish_epc_cutoff_month, "next_scottish_dump_month": next_scottish_dump_month }}}
{% endif %}
<br>
{{_("You can continue with your old EPC but the energy supplier you have selected may not be able to help based on an out-of-date EPC")}}
Expand Down
2 changes: 1 addition & 1 deletion help_to_heat/templates/frontdoor/no-epc.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1 class="govuk-heading-l">{{_("We could not find an Energy Performance Certifi
{% if show_month_wording %}
<p class="govuk-body">{{_("If your property has had a new EPC issued since 1 %(current_month)s, we may not be able to find it in our database because it is only updated monthly. Please return to this service after 1 %(next_month)s when we expect the database to have been updated.") % { "current_month": current_month, "next_month": next_month }}}</p>
{% else %}
<p class="govuk-body">{{_("If your property was issued an EPC since 1 %(current_quarter_month)s, we may not be able to find it in our database because it is updated quarterly. Please return to this service after 1 %(next_quarter_month)s when we expect the database to have been updated.") % { "current_quarter_month": current_quarter_month, "next_quarter_month": next_quarter_month }}}</p>
<p class="govuk-body">{{_("If your property was issued an EPC since 1 %(scottish_epc_cutoff_month)s, we may not be able to find it in our database because it is updated quarterly. Please return to this service after 1 %(next_scottish_dump_month)s when we expect the database to have been updated.") % { "scottish_epc_cutoff_month": scottish_epc_cutoff_month, "next_scottish_dump_month": next_scottish_dump_month }}}</p>
{% endif %}
<br>
<p class="govuk-body">{{_("You may continue using this service without an EPC.")}}</p>
Expand Down
15 changes: 8 additions & 7 deletions help_to_heat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,12 @@ def get_current_and_next_month_names(month_names):
return current_month, next_month


# Q1 january -> april
# Q2 april -> july
# Q3 july -> october
# Q4 october -> january
# Latest Quarter in current dump -> epc cutoff month, next expected dump month
# Q1 -> april, august
# Q2 -> july, november
# Q3 -> october, february
# Q4 -> january, may
# we update the month names manually on each scottish data dump
# this is to tell the user the month of the last dump, and expected month of next dump
def get_current_and_next_quarter_month_names(month_names):
return month_names[6], month_names[9]
# this is to tell the user the first month we have no EPCs for, and the next month we expect to perform a dump
def get_current_scottish_epc_cutoff_and_next_dump_month_names(month_names):
return month_names[9], month_names[1]

0 comments on commit 33bfdcf

Please sign in to comment.