Abstracts not working after deleting assigned Track

Dear all,

one of our event managers deleted some tracks.
Now we have abstracts with tracks assigned that do not exist any more.

Every time when trying to open one of these abstracts, we get the error message:
‘None’ has no attribute ‘can_review_abstracts’

Do anyone of you have any advices in fixing this problem?

Thanks,
Stefan

Could you please provide the full traceback from the Indico log file?

1 Like
2022-06-21 11:22:18,521  976125f9bece4a79  indico.flask - ERROR errors.py:99 -- 'None' has no attribute 'can_review_abstracts'

Traceback (most recent call last):
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/flask/util.py", line 82, in wrapper
    return obj().process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py", line 275, in process
    res = self._do_process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/controllers/base.py", line 88, in _do_process
    return RHEventBase._do_process(self)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py", line 245, in _do_process
    rv = self._process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/controllers/abstract.py", line 43, in _process
    return render_abstract_page(self.abstract, view_class=self.view_class, management=self.management)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/views.py", line 69, in render_abstract_page
    return view_class.render_template('abstract.html', abstract.event, **params)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/views.py", line 128, in render_template
    return cls(g.rh, *wp_args, **context).display()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/views.py", line 264, in display
    body = to_unicode(self._display(params))
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/views.py", line 353, in _display
    return self._apply_decoration(self._get_body(params))
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/management/views.py", line 58, in _get_body
    return self._get_page_content(params)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/views.py", line 158, in _get_page_content
    return self.render_template_func(template, **params)
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/templating.py", line 140, in render_template
    ctx.app,
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/templating.py", line 120, in _render
    rv = template.render(context)
  File "/opt/indico/.venv/lib/python2.7/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/opt/indico/.venv/lib/python2.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/templates/abstract.html", line 8, in top-level template code
    {% from 'events/reviews/_common.html' import render_decision_box %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/templates/management/_base.html", line 1, in top-level template code
    {% extends 'layout/base.html' if standalone else 'events/management/base.html' %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/management/templates/base.html", line 3, in top-level template code
    {% from 'message_box.html' import message_box %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/templates/layout/management_page.html", line 4, in top-level template code
    {% set show_banner_area = self.display_view_button() or self.banner_title() or self.banner_actions() %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/templates/layout/base.html", line 1, in top-level template code
    {% block page %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/management/templates/base.html", line 49, in block "page"
    {{ super() }}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/templates/layout/management_page.html", line 39, in block "page"
    {{ super() }}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/templates/layout/base.html", line 51, in block "page"
    {% block content %}{% endblock %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/templates/abstract.html", line 25, in block "content"
    {% call(block, __) render_timeline(abstract, comment_form, review_form) %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/jinja2/runtime.py", line 679, in _invoke
    rv = self._func(*arguments)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/templates/reviews/timeline.html", line 32, in template
    {{ render_review(item, form=form) }}
  File "/opt/indico/.venv/lib/python2.7/site-packages/jinja2/runtime.py", line 679, in _invoke
    rv = self._func(*arguments)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/templates/reviews/timeline.html", line 132, in template
    {{ render_track(review.group.instance) }}
  File "/opt/indico/.venv/lib/python2.7/site-packages/jinja2/runtime.py", line 679, in _invoke
    rv = self._func(*arguments)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/templates/reviewing/_common.html", line 14, in template
    {%- if track.can_review_abstracts(session.user) or track.can_convene(session.user) -%}
UndefinedError: 'None' has no attribute 'can_review_abstracts'

Thanks, we’ll look into it…

PS: You really need to update your Indico instance. v2.x is obsolete and still uses Python 2 (EOL: January 2020). Any bugfix we may release for this will go only in the upcoming 3.2 release and possibly into the currently stable 3.1 as well.

1 Like

Thanks, for your fast response.
This is our old server, only hosting some older events that are still running. The new one is already on the newest build version.
Would it be possible to fix this problem in indico shell, just to repair this problem for this old event?

Best, Stefan

diff --git a/indico/modules/events/templates/reviews/timeline.html b/indico/modules/events/templates/reviews/timeline.html
index 2326c22834..4aaf93ef4b 100644
--- a/indico/modules/events/templates/reviews/timeline.html
+++ b/indico/modules/events/templates/reviews/timeline.html
@@ -129,7 +129,7 @@
                     {% endif %}
                 </div>
                 {% if proposal.proposal_type == 'abstract' %}
-                    {{ render_track(review.group.instance) }}
+                    {{ render_track(review.group.instance) if review.group.instance else 'deleted track' }}
                 {% else %}
                     {{ render_group(review.group.title) }}
                 {% endif %}

Try this workaround… I haven’t tested thoroughly yet, but at least viewing the abstract works again like this.

1 Like

Thank you very much.
After changing this, the error still exists.

a Change in

opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/templates/reviewing/_common.html

did it for me

{%- if track != none -%}
        {%- if track.can_review_abstracts(session.user) or track.can_convene(session.user) -%}
                {%- set url = url_for('.display_reviewable_track_abstracts', track) -%}
        {%- endif -%}
{%- endif -%}

Do you have a traceback of the error when you had my fix applied? It worked for me locally, but maybe you were on a different page or there are some circumstances where the macro gets called as well…

Yes, of course.
I got the error when in the abstract list of the specific event.

2022-06-21 14:17:05,972 a79e8ddf55fe433c indico.flask - ERROR errors.py:99 – ‘None’ has no attribute ‘can_review_abstracts’

Traceback (most recent call last):
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/flask/util.py", line 82, in wrapper
    return obj().process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py", line 275, in process
    res = self._do_process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/controllers/base.py", line 88, in _do_process
    return RHEventBase._do_process(self)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py", line 245, in _do_process
    rv = self._process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/controllers/abstract.py", line 43, in _process
    return render_abstract_page(self.abstract, view_class=self.view_class, management=self.management)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/views.py", line 69, in render_abstract_page
    return view_class.render_template('abstract.html', abstract.event, **params)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/views.py", line 128, in render_template
    return cls(g.rh, *wp_args, **context).display()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/views.py", line 264, in display
    body = to_unicode(self._display(params))
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/views.py", line 353, in _display
    return self._apply_decoration(self._get_body(params))
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/management/views.py", line 58, in _get_body
    return self._get_page_content(params)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/views.py", line 158, in _get_page_content
    return self.render_template_func(template, **params)
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/templating.py", line 140, in render_template
    ctx.app,
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/templating.py", line 120, in _render
    rv = template.render(context)
  File "/opt/indico/.venv/lib/python2.7/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/opt/indico/.venv/lib/python2.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/templates/abstract.html", line 8, in top-level template code
    {% from 'events/reviews/_common.html' import render_decision_box %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/templates/management/_base.html", line 1, in top-level template code
    {% extends 'layout/base.html' if standalone else 'events/management/base.html' %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/management/templates/base.html", line 3, in top-level template code
    {% from 'message_box.html' import message_box %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/templates/layout/management_page.html", line 4, in top-level template code
    {% set show_banner_area = self.display_view_button() or self.banner_title() or self.banner_actions() %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/templates/layout/base.html", line 1, in top-level template code
    {% block page %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/management/templates/base.html", line 49, in block "page"
    {{ super() }}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/templates/layout/management_page.html", line 39, in block "page"
    {{ super() }}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/templates/layout/base.html", line 51, in block "page"
    {% block content %}{% endblock %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/templates/abstract.html", line 25, in block "content"
    {% call(block, __) render_timeline(abstract, comment_form, review_form) %}
  File "/opt/indico/.venv/lib/python2.7/site-packages/jinja2/runtime.py", line 679, in _invoke
    rv = self._func(*arguments)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/templates/reviews/timeline.html", line 32, in template
    {{ render_review(item, form=form) }}
  File "/opt/indico/.venv/lib/python2.7/site-packages/jinja2/runtime.py", line 679, in _invoke
    rv = self._func(*arguments)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/templates/reviews/timeline.html", line 132, in template
    {{ render_track(review.group.instance) if review.group.instance else 'deleted track' }}
  File "/opt/indico/.venv/lib/python2.7/site-packages/jinja2/runtime.py", line 679, in _invoke
    rv = self._func(*arguments)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/abstracts/templates/reviewing/_common.html", line 14, in template
    {%- if track.can_review_abstracts(session.user) or track.can_convene(session.user) -%}
UndefinedError: 'None' has no attribute 'can_review_abstracts'

Strange. Are you sure you restarted uwsgi after applying the patch? This is literally the code my patch updates, and it’s included in your traceback which could happen if the code that’s running is different from the code on disk…

I’m pretty sure i restarted the whole server but not 100%.
I will double check as soon as possible.

But at all, I’m very happy for your quick response and the first-class help.

Thank you very much.
Stefan

1 Like