-
Notifications
You must be signed in to change notification settings - Fork 1
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
PC-1464: Improve select your supplier question #411
PC-1464: Improve select your supplier question #411
Conversation
0f450e8
to
479b9e5
Compare
noticed I've missed error texts, will push a fix |
479b9e5
to
55db761
Compare
help_to_heat/frontdoor/interface.py
Outdated
supplier = api.session.get_answer(self.session_id, supplier_page).get(supplier_field) | ||
alternative_supplier = api.session.get_answer(self.session_id, alternative_supplier_page).get( | ||
alternative_supplier_field | ||
) | ||
|
||
return alternative_supplier if self._did_specify_alternative() else supplier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's real overhead to api.session.get_answer
is there? We could be quite a bit more efficient with how many times we're calling it if so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think so too much, though it is a database call. have reworked it to cache the result
help_to_heat/frontdoor/interface.py
Outdated
session_data[supplier_field] = "Octopus Energy" | ||
if self._is_utility_warehouse(): | ||
session_data["supplier"] = "E.ON Next" | ||
session_data[supplier_field] = "E.ON Next" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be using constants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
# where to send the user post them picking a supplier | ||
def _post_supplier_pick_next_page(supplier): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be named better so the comment isn't necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking back I don't think the comment adds much anyway. have removed it & changed the name slightly
help_to_heat/frontdoor/consts.py
Outdated
@@ -104,7 +108,7 @@ | |||
supplier_field_shell = "Shell" | |||
supplier_field_utilita = "Utilita" | |||
supplier_field_utility_warehouse = "Utility Warehouse" | |||
supplier_fields = [ | |||
supplier_fields_real = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be made to read a bit more naturally? Would quibble that these aren't fields, they're values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for what its worth most of these fields could be named as such, ie supplier_field_utilitia
-> supplier_field_value_utilita
. for now have renamed the fields
to field_values
55db761
to
f5869e3
Compare
translations for "Select an alternative energy supplier" have been added |
when supplier is referenced, make a safe call that allows it to be overridden with the alternative if needed make the check answers page for supplier send to alternative supplier if needed overwrite supplier with alternative if necessary when generating referral
f5869e3
to
dc6469a
Compare
@jdgage if there's nothing else & pipelines pass this should be ready to go |
Link to Jira ticket
Description
adds an alternative supplier page
if the user selects that they don't know they are sent here and can select any supplier
needs some extra work when displaying supplier name to ensure the correct supplier is always shown, as well as some additional work when submitting so energy suppliers see the alternative that was picked
Checklist
make extract-translations
Screenshots