Skip to content

Conversation

@ThiefMaster
Copy link
Member

@ThiefMaster ThiefMaster commented Jul 31, 2025

When a user registered and paid, and an accommodation field got added to the form afterwards, updating the registration failed because calculating the previous price tried to call len(None).

  File "indico/modules/events/registration/util.py", line 516, in modify_registration
    _set_data(form_item, value)
  File "indico/modules/events/registration/util.py", line 463, in _set_data
    attrs = field.field_impl.process_form_data(registration, value, data_by_field[field.id],
  File "indico/modules/events/registration/fields/base.py", line 322, in process_form_data
    if billable_items_locked and old_data.price != self.calculate_price(value, new_data_version.versioned_data):
  File "indico/modules/events/registration/models/registrations.py", line 906, in price
    return self.field_data.field.calculate_price(self)
  File "indico/modules/events/registration/models/form_fields.py", line 113, in calculate_price
    return self.field_impl.calculate_price(registration_data.data, registration_data.field_data.versioned_data)
  File "indico/modules/events/registration/fields/accompanying.py", line 87, in calculate_price
    return Decimal(str(versioned_data.get('price', 0))) * len(reg_data)

@ThiefMaster ThiefMaster added this to the v3.3 milestone Jul 31, 2025
@ThiefMaster ThiefMaster marked this pull request as ready for review July 31, 2025 10:15
@ThiefMaster ThiefMaster merged commit 22a3806 into indico:master Jul 31, 2025
11 checks passed
@ThiefMaster ThiefMaster deleted the regform-acco-price branch July 31, 2025 10:26
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

Successfully merging this pull request may close these issues.

1 participant