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

accounts: "Security" gives an exception with CERN login #146

Closed
GraemeWatt opened this issue Sep 18, 2018 · 1 comment
Closed

accounts: "Security" gives an exception with CERN login #146

GraemeWatt opened this issue Sep 18, 2018 · 1 comment

Comments

@GraemeWatt
Copy link
Member

Clicking "Security" gives an exception for an account connected via CERN OAuth:

[2018-09-18 17:12:36,620] ERROR in app: Exception on /account/settings/security/ [GET]
Traceback (most recent call last):
  File "/opt/hepdata/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/hepdata/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/hepdata/lib/python2.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/opt/hepdata/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/hepdata/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/hepdata/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/hepdata/lib/python2.7/site-packages/flask_login.py", line 792, in decorated_view
    return func(*args, **kwargs)
  File "/opt/hepdata/lib/python2.7/site-packages/invenio_accounts/views.py", line 140, in security
    is_current=SessionActivity.is_current
  File "/opt/hepdata/lib/python2.7/site-packages/flask/templating.py", line 134, in render_template
    context, ctx.app)
  File "/opt/hepdata/lib/python2.7/site-packages/flask/templating.py", line 116, in _render
    rv = template.render(context)
  File "/opt/hepdata/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/opt/hepdata/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/hepdata/lib/python2.7/site-packages/invenio_accounts/templates/invenio_accounts/settings/security.html", line 32, in top-level template code
    {% set revoke_action = _("Revoke") %}
  File "/opt/hepdata/lib/python2.7/site-packages/invenio_theme/templates/invenio_theme/page_settings.html", line 25, in top-level template code
    {%- extends config.THEME_BASE_TEMPLATE %}
  File "/opt/hepdata/src/hepdata/hepdata/modules/theme/templates/hepdata_theme/page.html", line 25, in top-level template code
    {%- extends "invenio_theme/page.html" %}
  File "/opt/hepdata/lib/python2.7/site-packages/invenio_theme/templates/invenio_theme/page.html", line 73, in top-level template code
    {%- block body %}
  File "/opt/hepdata/lib/python2.7/site-packages/invenio_theme/templates/invenio_theme/page.html", line 79, in block "body"
    {%- block body_inner %}
  File "/opt/hepdata/lib/python2.7/site-packages/invenio_theme/templates/invenio_theme/page.html", line 83, in block "body_inner"
    {%- block page_body %}
  File "/opt/hepdata/lib/python2.7/site-packages/invenio_theme/templates/invenio_theme/page_settings.html", line 49, in block "page_body"
    {%- block settings_content scoped %}
  File "/opt/hepdata/lib/python2.7/site-packages/invenio_theme/templates/invenio_theme/page_settings.html", line 62, in block "settings_content"
    {%- block settings_body scoped %}
  File "/opt/hepdata/lib/python2.7/site-packages/invenio_theme/templates/invenio_theme/page_settings.html", line 64, in block "settings_body"
    {%- block settings_form scoped %}
  File "/opt/hepdata/lib/python2.7/site-packages/invenio_accounts/templates/invenio_accounts/settings/security.html", line 53, in block "settings_form"
    {{session.created | tousertimezone | dateformat}}
  File "/opt/hepdata/lib/python2.7/site-packages/invenio_i18n/jinja2.py", line 42, in filter_to_user_timezone
    return to_user_timezone(dt)
  File "/opt/hepdata/lib/python2.7/site-packages/flask_babelex/__init__.py", line 310, in to_user_timezone
    if datetime.tzinfo is None:
UndefinedError: 'None' has no attribute 'created'

Try upgrading the Invenio packages (#138), particularly invenio-accounts.

@GraemeWatt GraemeWatt changed the title invenio: accounts: "Security" gives an exception with CERN login Sep 18, 2018
@GraemeWatt
Copy link
Member Author

This problem seems to be fixed with the current Invenio packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant