Skip to content
Snippets Groups Projects
Commit ee01ef40 authored by Jan Mach's avatar Jan Mach
Browse files

Fix: Fixed issue with invalid time windows when linking between event search and timeline views.

As it turned out the timepager component was modifiing request parameters to generate the links and subsequent components were unable to access original values. (Redmine issue: #4609)
parent bcf947a1
No related branches found
No related tags found
No related merge requests found
......@@ -490,6 +490,12 @@ def _setup_app_core(app):
res = json.load(fp)
return res
def make_copy_deep(data):
"""
Make a deep copy of given data structure.
"""
return copy.deepcopy(data)
return dict(
get_endpoints_dict = get_endpoints_dict,
get_endpoint_class = get_endpoint_class,
......@@ -521,7 +527,8 @@ def _setup_app_core(app):
json_to_yaml = json_to_yaml,
get_uuid4 = get_uuid4,
get_limit_counter = get_limit_counter,
load_json_from_file = load_json_from_file
load_json_from_file = load_json_from_file,
make_copy_deep = make_copy_deep
)
class HawatJSONEncoder(flask.json.JSONEncoder):
......
......@@ -184,7 +184,11 @@
----------------------------------------------------------------------------- #}
{%- macro render_timepager(qparams, dt_from, tiid) %}
{%- macro render_timepager(qparams_p, dt_from_p, tiid) %}
{%- if dt_from_p %}
{%- set qparams = make_copy_deep(qparams_p) %}
{%- set dt_from = make_copy_deep(dt_from_p) %}
{%- set dt_from = dt_from.replace(tzinfo = None) %}
{%- set dt_to = get_datetime_window(tiid, 'next', dt_from) %}
{%- if dt_from and dt_to %}
......@@ -216,6 +220,7 @@
</ul>
</nav>
{%- endif %}
{%- endif %}
{%- endmacro %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment