Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev -> staging #420

Merged
merged 15 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading