Add additional region infomation to output documents

This commit is contained in:
Dana Lambert 2021-12-01 10:06:30 +13:00 committed by Alistair McIntyre
parent f25c7bb7df
commit 3f251e4c68

View file

@ -83,6 +83,18 @@ def get_site_filters(request):
return filter_rows return filter_rows
def get_additional_region_info(request):
""" If the location coordinates fall within the CHCH or Auckland regions then return a description of where to find more information.
"""
coordinates = request.query_params.get('coordinates')
if coordinates is not None:
if is_in_christchurch(coordinates):
return [["Your location falls within the ecosystem type covered by the Christchurch Council ecosystem maps - further information can be obtained from Ōtautahi/Christchurch ecosystems map link to: https://ccc.govt.nz/environment/land/ecosystem-map", " "], [' ', ' ']]
elif is_in_auckland(coordinates):
return [["Your location falls within the ecosystem type covered by the Auckland Council Tiaki Tāmaki Makaurau Conservation map - further information can be obtained from tiaki Tāmaki Makaurau conservation Auckland - link to https://www.tiakitamakimakaurau.nz/conservation-map/", " "], [' ', ' ']]
return []
def get_filter_values(request): def get_filter_values(request):
""" Retrives all selected values/filters from the request. """ Retrives all selected values/filters from the request.
""" """
@ -100,6 +112,8 @@ def get_filter_values(request):
filter_rows += get_site_filters(request) filter_rows += get_site_filters(request)
filter_rows.append([' ', ' ']) filter_rows.append([' ', ' '])
filter_rows += get_additional_region_info(request)
return filter_rows return filter_rows