Unexpected Exception occurred at <my_indico_host>: 'NoneType' object has no attribute 'is_ticket'

we are receiving the following error from the Indico logger:

2024-04-10 11:24:10,201  d956951dddf64a96  893     indico.flask - ERROR errors.py:110 -- 'NoneType' object has no attribute 'is_ticket'

Traceback (most recent call last):
  File "/opt/indico/.venv/lib/python3.12/site-packages/flask/app.py", line 870, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/indico/.venv/lib/python3.12/site-packages/flask/app.py", line 855, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/opt/indico/.venv/lib/python3.12/site-packages/indico/web/flask/util.py", line 80, in wrapper
    return obj().process()
  File "/opt/indico/.venv/lib/python3.12/site-packages/indico/web/rh.py", line 299, in process
    res = self._do_process()
  File "/opt/indico/.venv/lib/python3.12/site-packages/indico/web/rh.py", line 267, in _do_process
    rv = self._process()
  File "/opt/indico/.venv/lib/python3.12/site-packages/indico/modules/events/registration/controllers/management/reglists.py", line 332, in _process
    template_is_ticket = self.regform.get_ticket_template().is_ticket
AttributeError: 'NoneType' object has no attribute 'is_ticket'

Is this anything we should be worried about?

Thank you very much,
Cristiano Urban.

Can you check your top-level category settings (you can append /category/0/manage/designer/ to your Indico URL to get there directly)? There should be a “Default badge” and (more important in this case) “Default ticket” template listed.

The error you get sounds a bit like the latter is missing (or is not marked as the global default for some reason).

thank you for the quick answer.

I can see only the Default badge, the Default ticket is missing.
If I click on the Add new button, I can only choose between Badge and Poster on the Template drop-down list.

A ticket template is simply a badge template containing the QR code field.

You can also use this code in indico shell to create the default template:

from indico.core.db.sqlalchemy.util.management import DEFAULT_TICKET_DATA
from indico.modules.designer import TemplateType
cat = Category.get_root()
dtt = DesignerTemplate(category_id=cat.id, title='Default ticket', type=TemplateType.badge, data=DEFAULT_TICKET_DATA, is_system_template=True)
cat.default_ticket_template = dtt

thank you very much, just created via indico shell.