AttributeError: 'NoneType' object has no attribute 'isoformat'

Dear all,

when someone tries to register to one of our events he or she will get the following error:

Has anyone an idea what is wrong with this registration form?

Best,
Barbara

1 Like

Can you please check (or have someone with server access check) indico.log on the server for the full error and its traceback? It’s likely a trivial fix, but without knowing where exactly it comes from, it’s pretty much impossible to fix

Hi Adrian,

I will forward you a private message with the error.

Thanks, I’ll paste the non-sensitive parts of it here for the sake of completeness:

Traceback (most recent call last):
  File "/data/indico/.venv/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/indico/.venv/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/indico/.venv/lib/python3.12/site-packages/indico/web/flask/util.py", line 80, in wrapper
    return obj().process()
           ^^^^^^^^^^^^^^^
  File "/data/indico/.venv/lib/python3.12/site-packages/indico/web/rh.py", line 307, in process
    res = self._do_process()
          ^^^^^^^^^^^^^^^^^^
  File "/data/indico/.venv/lib/python3.12/site-packages/indico/modules/events/controllers/base.py", line 106, in _do_process
    return RHEventBase._do_process(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/indico/.venv/lib/python3.12/site-packages/indico/web/rh.py", line 275, in _do_process
    rv = self._process()
         ^^^^^^^^^^^^^^^
  File "/data/indico/.venv/lib/python3.12/site-packages/indico/web/rh.py", line 213, in _process
    return method()
           ^^^^^^^^
  File "/data/indico/.venv/lib/python3.12/site-packages/indico/modules/events/registration/controllers/display.py", line 383, in _process_POST
    registration = create_registration(self.regform, form_data, self.invitation)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/indico/.venv/lib/python3.12/site-packages/indico/core/db/sqlalchemy/util/session.py", line 18, in wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/data/indico/.venv/lib/python3.12/site-packages/indico/modules/events/registration/util.py", line 407, in create_registration
    for attr, field_value in form_item.field_impl.process_form_data(registration, value).items():
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/indico/.venv/lib/python3.12/site-packages/indico/modules/events/registration/fields/choices.py", line 622, in process_form_data
    data.update({'arrival_date': value['arrivalDate'].isoformat(),
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'isoformat'
1 Like

Thank you!

I don’t see an accommodation field in your registration form, but the error comes from the code related to that field. Do you have one that’s either in a manager-only section or disabled?

1 Like

Thank you very much! We revised the accommodation and now it works. :grinning:

it’s still a bug so an answer to my question where exactly that field was would be helpful to reproduce and fix it :wink:

We overworked this registration form on Tuesday and decided to disable the “No accommodation” field since there will be no guests without accommodation for this group. Everyone should stay in the “Erbacher Hof” or an alternative housing if they do not have enough rooms for this time.
Yesterday, after becoming aware of the issue with the accommodation field, we enabled it, and then it worked.

ok, so i managed to reproduce it: it happens when the accommodation field is in a manager-only section AND has the ‘no accommodation’ choice disabled

2 Likes

Ok, thank you!