inveniosoftware / invenio-rdm-records

DataCite-based data model for InvenioRDM flavour.
https://invenio-rdm-records.readthedocs.io
MIT License
15 stars 87 forks source link

templates: bug in doi.html preventing rendering #81

Closed lnielsen closed 4 years ago

lnielsen commented 4 years ago

Following code in doi.html produces and error with the latest test records:

{%- set id_doi = record.identifiers|doi_identifier %}

Traceback:

Traceback (most recent call last):
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/app.py", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/werkzeug/middleware/proxy_fix.py", line 232, in __call__
    return self.app(environ, start_response)
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/werkzeug/middleware/dispatcher.py", line 66, in __call__
    return app(environ, start_response)
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/app.py", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/app.py", line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/invenio_records_ui/views.py", line 205, in record_view
    return view_method(pid, record, template=template, **kwargs)
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/invenio_records_ui/views.py", line 227, in default_view_method
    record=record,
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/templating.py", line 140, in render_template
    ctx.app,
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/flask/templating.py", line 120, in _render
    rv = template.render(context)
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "/Users/lnielsen/src/invenio-rdm-records/invenio_rdm_records/theme/templates/invenio_rdm_records/record_landing_page.html", line 9, in top-level template code
    {%- extends config.BASE_TEMPLATE %}
  File "/Users/lnielsen/src/invenio-app-rdm/invenio_app_rdm/theme/templates/invenio_app_rdm/page.html", line 7, in top-level template code
    #}
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/invenio_theme/templates/invenio_theme/page.html", line 28, in top-level template code
    {%- endblock head_title %}
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/invenio_theme/templates/invenio_theme/page.html", line 31, in block "body"
    {%- if keywords %}<link rel="canonical" href="{{ canonical_url }}"/>{% endif %}
  File "/Users/lnielsen/envs/cli/lib/python3.6/site-packages/invenio_theme/templates/invenio_theme/page.html", line 32, in block "body_inner"
    {%- block head_links_langs %}
  File "/Users/lnielsen/src/invenio-rdm-records/invenio_rdm_records/theme/templates/invenio_rdm_records/record_landing_page.html", line 12, in block "page_body"
    {{ webpack['invenio-app-rdm-theme.css'] }}
  File "/Users/lnielsen/src/invenio-rdm-records/invenio_rdm_records/theme/templates/invenio_rdm_records/record_landing_page.html", line 35, in block "record_body"
    </span>
  File "/Users/lnielsen/src/invenio-rdm-records/invenio_rdm_records/theme/templates/invenio_rdm_records/details/doi.html", line 7, in top-level template code
    #}
  File "/Users/lnielsen/src/invenio-rdm-records/invenio_rdm_records/theme/views.py", line 115, in doi_identifier
    if id['scheme'] == "DOI":
TypeError: string indices must be integers
ppanero commented 4 years ago

closed by https://github.com/inveniosoftware/invenio-rdm-records/pull/83