Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

templates: bug in doi.html preventing rendering #81

Closed
lnielsen opened this issue Mar 23, 2020 · 1 comment
Closed

templates: bug in doi.html preventing rendering #81

lnielsen opened this issue Mar 23, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@lnielsen
Copy link
Member

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
@lnielsen lnielsen added the bug Something isn't working label Mar 23, 2020
@zzacharo zzacharo self-assigned this Mar 23, 2020
zzacharo added a commit to zzacharo/invenio-rdm-records that referenced this issue Mar 24, 2020
* Fix `doi_identifier` template filter
* Create a template filter called `format_date`
  to accept date strings without formatting them.
  This is needed to handle edtf dates for now.

closes inveniosoftware#80, inveniosoftware#81
zzacharo added a commit to zzacharo/invenio-rdm-records that referenced this issue Mar 24, 2020
* Fix `doi_identifier` template filter
* Create a template filter called `format_date`
  to accept date strings without formatting them.
  This is needed to handle edtf dates for now.

closes inveniosoftware#80, inveniosoftware#81
zzacharo added a commit to zzacharo/invenio-rdm-records that referenced this issue Mar 24, 2020
* Fix `doi_identifier` template filter
* Create a template filter called `format_date`
  to accept date strings without formatting them.
  This is needed to handle edtf dates for now.

closes inveniosoftware#80, inveniosoftware#81
@ppanero
Copy link
Member

ppanero commented Mar 25, 2020

closed by #83

@ppanero ppanero closed this as completed Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants