Skip to content

Commit

Permalink
Break into separate property
Browse files Browse the repository at this point in the history
  • Loading branch information
iwootten committed Aug 14, 2020
1 parent d5c042e commit 7abc92b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/views/contexts/hub_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ def get_context(self, survey_complete, enabled_section_ids) -> Mapping:

return {
"individual_response_enabled": individual_response_enabled,
"individual_response_url": url_for(
"individual_response.request_individual_response", return_to="hub"
)
if individual_response_enabled
else None,
"individual_response_url": self._individual_response_url,
"guidance": guidance,
"rows": rows,
"submit_button": submit_button,
Expand Down Expand Up @@ -215,3 +211,11 @@ def _individual_response_enabled(self) -> bool:
return False

return True

@cached_property
def _individual_response_url(self) -> Union[str, None]:
if self._individual_response_enabled:
return url_for(
"individual_response.request_individual_response", return_to="hub"
)
return None

0 comments on commit 7abc92b

Please sign in to comment.