Commit 605bf065 authored by Merret Buurman's avatar Merret Buurman
Browse files

Remove hdl: from handle before even making html pages.

parent fc27b94e
...@@ -7,6 +7,7 @@ from landingpage.landingpageapp.handle import retrieval, cmip6parser ...@@ -7,6 +7,7 @@ from landingpage.landingpageapp.handle import retrieval, cmip6parser
def get_html_string(request, prefix, suffix): def get_html_string(request, prefix, suffix):
prefix = _remove_hdl_from_prefix(prefix)
json_record = retrieval.get_handle_record_json(prefix+'/'+suffix) json_record = retrieval.get_handle_record_json(prefix+'/'+suffix)
context = _get_context_for_aggregation_level(json_record) context = _get_context_for_aggregation_level(json_record)
template = _get_template_for_aggregation_level(json_record) template = _get_template_for_aggregation_level(json_record)
...@@ -34,3 +35,8 @@ def _get_context_for_aggregation_level(json_record): ...@@ -34,3 +35,8 @@ def _get_context_for_aggregation_level(json_record):
def _get_handle_info_for_dataset(values): def _get_handle_info_for_dataset(values):
return {} return {}
def _remove_hdl_from_prefix(prefix):
if prefix.startswith('hdl:'):
return prefix.replace('hdl:','')
else:
return prefix
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment