Skip to content

Commit

Permalink
Merge pull request #420 from UKGovernmentBEIS/develop
Browse files Browse the repository at this point in the history
dev -> staging
  • Loading branch information
samyou-softwire authored Jan 7, 2025
2 parents deb4768 + 00f7b9a commit bf8abdc
Show file tree
Hide file tree
Showing 7 changed files with 450 additions and 406 deletions.
5 changes: 5 additions & 0 deletions help_to_heat/frontdoor/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@
"Apartment, flat or maisonette": _("apartment, flat or maisonette"),
}

# if wording changes, old answers should be left in this map
# otherwise, an error will be thrown on check answers page for these old users
# see loft_insulation_field for an example
check_your_answers_options_map = {
country_field: {
country_field_england: _("England"),
Expand Down Expand Up @@ -489,6 +492,8 @@
loft_insulation_field_no_insulation: _("I have no loft insulation"),
loft_insulation_field_dont_know: _("I do not know"),
loft_insulation_field_no_loft: _("No loft"),
# deprecated as part of PC-1364. see comment on this map
"I have up to 100mm of loft insulation": _("I have less than or equal to 100mm of loft insulation"),
},
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from datetime import datetime
from datetime import datetime, timezone

import pytz
from dateutil.relativedelta import relativedelta

from help_to_heat import portal
Expand All @@ -27,10 +26,10 @@ def _try_find_most_recent_duplicate_referral_within_range(self, recent_interval_
uprn = session_data.get(uprn_field)
if not uprn:
return None
recent_cutoff_date = datetime.utcnow() + relativedelta(months=-recent_interval_months)
recent_cutoff_date = datetime.now(timezone.utc) + relativedelta(months=-recent_interval_months)
duplicate_referrals = (
portal.models.Referral.objects.filter(data__uprn=uprn)
.filter(created_at__gte=recent_cutoff_date.astimezone(pytz.UTC))
.filter(created_at__gte=recent_cutoff_date.astimezone(timezone.utc))
.order_by("-created_at")
)
if len(duplicate_referrals) == 0:
Expand Down
6 changes: 4 additions & 2 deletions help_to_heat/frontdoor/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,10 @@ def _inner(func):


def redirect_to_homepage_view(request):
next_url = govuk_start_page_url
return redirect(next_url)
if settings.DEBUG:
return start_view(request)
else:
return redirect(govuk_start_page_url)


def start_view(request):
Expand Down
Loading

0 comments on commit bf8abdc

Please sign in to comment.