Registration

Introduction

The Registration Form module relies on a data model which can be slightly complex at a first glance, due to the basic “version control” of fields which Indico does, in order to allow for modifications after users have registered.

classDiagram class RegistrationData { data } class RegistrationFormFieldData { versioned_data } RegistrationForm --o RegistrationFormItem RegistrationFormItem --o RegistrationFormItem : children RegistrationForm --o Registration Registration "1" --o RegistrationData : field_data RegistrationFormFieldData "1" --o RegistrationData RegistrationFormFieldData "1" -- "1" RegistrationFormItem : current_data RegistrationFormItem "1" --o RegistrationFormFieldData : data_versions

Some notes on these model classes:

Models

class indico.modules.events.registration.models.registrations.PublishRegistrationsMode(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)
hide_all = 0
show_all = 2
class indico.modules.events.registration.models.registrations.Registration(**kwargs)

Somebody’s registration for an event through a registration form.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

property accompanying_persons
property avatar_url

Return the url of the user’s avatar.

base_price

The base registration fee (that is not specific to form items)

property billable_data
property can_be_modified
property can_be_withdrawn
checked_in

Whether the person has checked in. Setting this also sets or clears checked_in_dt.

checked_in_dt

The date/time when the person has checked in

consent_to_publish

Type of consent given to publish this registration

created_by_manager

Whether the registration was created by a manager

currency

Registration price currency

data

The registration this data is associated with

property data_by_field
property display_full_name

Return the full name using the user’s preferred name format.

property display_regform_url
email

The email of the registrant

event

The Event containing this registration

event_id

The ID of the event

property external_registration_details_url
first_name

The first name of the registrant

friendly_id

The human-friendly ID for the object

property full_name

Return the user’s name in ‘Firstname Lastname’ notation.

generate_ticket_google_wallet_url()

Return link to Google Wallet ticket display.

classmethod get_all_for_event(event)

Retrieve all registrations in all registration forms of an event.

get_full_name(*, last_name_first=True, last_name_upper=False, abbrev_first_name=False)

Return the user’s name in the specified notation.

If no format options are specified, the name is returned in the ‘Lastname, Firstname’ notation.

Parameters:
  • last_name_first – if “lastname, firstname” instead of “firstname lastname” should be used

  • last_name_upper – if the last name should be all-uppercase

  • abbrev_first_name – if the first name should be abbreviated to use only the first character

get_personal_data()
get_personal_data_picture()
property google_wallet_ticket_id
has_conflict()

Check if there are other valid registrations for the same user.

This is intended for cases where this registration is currenly invalid (rejected or withdrawn) to determine whether it would be acceptable to restore it.

property has_files
id

The ID of the object

is_active
is_cancelled
is_deleted

If the registration has been deleted

property is_paid

Return whether the registration has been paid for.

is_pending_transaction_expired()

Check if the registration has a pending transaction that expired.

is_publishable(is_participant)
is_state_publishable
property is_ticket_blocked

Check whether the ticket is blocked by a plugin.

last_name

The last name of the registrant

locator

Define a smart locator property.

This behaves pretty much like a normal read-only property and the decorated function should return a dict containing the necessary data to build a URL for the object.

This decorator should usually be applied to a method named locator as this name is required for get_locator to find it automatically when just passing the object.

If you need more than one locator, you can define it like this:

@locator_property
def locator(self):
    return {...}

@locator.other
def locator(self):
    return {...}

The other locator can then be accessed by passing obj.locator.other to the code expecting an object with a locator.

log(*args, **kwargs)

Log with prefilled metadata for the registration.

classmethod merge_users(target, source)
property modification_deadline_passed
modification_end_dt

The date/time until which the person can modify their registration

order_by_name = (<sqlalchemy.sql.functions.Function at 0x7f89911d8c20; lower>, <sqlalchemy.sql.functions.Function at 0x7f89911d8da0; lower>, <sqlalchemy.orm.attributes.InstrumentedAttribute object>)
participant_hidden

Management-set override for visibility

property payment_dt

The date/time when the registration has been paid for.

property price

The total price of the registration.

This includes the base price, the field-specific price, and the custom price adjustment for the registrant.

Return type:

Decimal

price_adjustment

The price modifier applied to the final calculated price

property published_receipts
query: IndicoBaseQuery

A SQLAlchemy query for a model. Equivalent to db.session.query(Model). Can be customized per-model by overriding query_class.

Warning

The query interface is considered legacy in SQLAlchemy. Prefer using session.execute(select()) instead.

registration_form_id

The ID of the registration form

rejection_reason

If given a reason for rejection

render_base_price()
render_price()
render_price_adjustment()
property sections_with_answered_fields
state

The state a registration is in

submitted_dt

The date/time when the registration was recorded

property summary_data

Export registration data nested in sections and fields.

sync_state(_skip_moderation=True)

Sync the state of the registration.

tags

The registration tags assigned to this registration

ticket_uuid

The unique token used in tickets

transaction

The latest payment transaction associated with this registration

transaction_id

The ID of the latest payment transaction associated with this registration

update_state(approved=None, paid=None, rejected=None, withdrawn=None, _skip_moderation=False)

Update the state of the registration for a given action.

The accepted kwargs are the possible actions. True means that the action occured and False that it was reverted.

user
user_id

The ID of the user who registered

uuid

The unguessable ID for the object

property visibility
property visibility_before_override
class indico.modules.events.registration.models.registrations.RegistrationData(**kwargs)

Data entry within a registration for a field in a registration form.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

add_file_date_column = False

Whether to track the creation time. This is required when using versioning!

content_type

The MIME type of the file.

created_dt = None
data

The submitted data for the field

extension

The extension of the file.

field_data

The associated field data object

field_data_id

The ID of the field data

property file
file_required = False

Whether a row must always contain a file

filename

The name of the file.

property friendly_data
get_friendly_data(**kwargs)
locator

Define a smart locator property.

This behaves pretty much like a normal read-only property and the decorated function should return a dict containing the necessary data to build a URL for the object.

This decorator should usually be applied to a method named locator as this name is required for get_locator to find it automatically when just passing the object.

If you need more than one locator, you can define it like this:

@locator_property
def locator(self):
    return {...}

@locator.other
def locator(self):
    return {...}

The other locator can then be accessed by passing obj.locator.other to the code expecting an object with a locator.

md5

An MD5 hash of the file.

Automatically assigned when save() is called.

property price
registration_id

The ID of the registration

render_price()
property search_data
size

The size of the file (in bytes).

Automatically assigned when save() is called.

storage_backend
storage_file_id
property summary_data
property user_data
class indico.modules.events.registration.models.registrations.RegistrationState(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)
complete = 1
pending = 2
rejected = 3
unpaid = 5
withdrawn = 4
class indico.modules.events.registration.models.registrations.RegistrationVisibility(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)
all = 2
nobody = 0
participants = 1
class indico.modules.events.registration.models.form_fields.RegistrationFormField(**kwargs)

A registration form field.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

calculate_price(registration_data)
children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

property field_impl

Gets the implementation of the field.

Returns:

An instance of a RegistrationFormFieldBase subclass

get_friendly_data(registration_data, **kwargs)
property html_field_name
id

The ID of the object

input_type

input type of this field

is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

property locator
parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery

A SQLAlchemy query for a model. Equivalent to db.session.query(Model). Can be customized per-model by overriding query_class.

Warning

The query interface is considered legacy in SQLAlchemy. Prefer using session.execute(select()) instead.

registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

property versioned_data
property view_data

Return object with data that the frontend can understand.

class indico.modules.events.registration.models.form_fields.RegistrationFormFieldData(**kwargs)

Description of a registration form field.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

field_id

The ID of the registration form field

id

The ID of the object

query: IndicoBaseQuery

A SQLAlchemy query for a model. Equivalent to db.session.query(Model). Can be customized per-model by overriding query_class.

Warning

The query interface is considered legacy in SQLAlchemy. Prefer using session.execute(select()) instead.

versioned_data

Data describing the field

class indico.modules.events.registration.models.form_fields.RegistrationFormPersonalDataField(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

property html_field_name
id

The ID of the object

input_type

input type of this field

is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery

A SQLAlchemy query for a model. Equivalent to db.session.query(Model). Can be customized per-model by overriding query_class.

Warning

The query interface is considered legacy in SQLAlchemy. Prefer using session.execute(select()) instead.

registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

property view_data

Return object with data that the frontend can understand.

class indico.modules.events.registration.models.forms.ModificationMode(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)
allowed_always = 1
allowed_until_approved = 4
allowed_until_payment = 2
not_allowed = 3
class indico.modules.events.registration.models.forms.RegistrationForm(**kwargs)

A registration form for an event.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

property active_fields
property active_labels
property active_registrations
property active_sections
attach_ical

If the completed registration email should include the event’s iCalendar file.

base_price

The base fee users have to pay when registering

can_submit(user)
property checked_in_registrations
contact_info

Contact information for registrants

currency

Currency for prices in the registration form

property disabled_sections
end_dt

Datetime when the registration form is closed

event

The Event containing this registration form

event_id

The ID of the event

form_items
get_personal_data_field_id(personal_data_type)

Return the field id corresponding to the personal data field with the given name.

get_registration(user=None, uuid=None, email=None)

Retrieve registrations for this registration form by user or uuid.

get_ticket_template()

Get the current ticket template or, if not set, the default category one.

has_ended
has_started
id

The ID of the object

property identifier
introduction
invitations

The registration invitations associated with this form

property is_active
is_deleted

Whether the registration has been marked as deleted

property is_google_wallet_available
property is_google_wallet_configured
is_modification_allowed(registration)

Check whether a registration may be modified.

is_modification_open
is_open
is_participant_list_visible(is_participant)
is_participation

Whether it’s the ‘Participants’ form of a meeting/lecture

is_purged

Whether the registrations have been deleted due to an expired retention period

is_scheduled
property limit_reached
property locator
log(*args, **kwargs)

Log with prefilled metadata for the regform.

manager_notification_recipients

List of emails that should receive management notifications

manager_notifications_enabled

Whether the manager notifications for this event are enabled

message_complete

Custom message to include in emails for complete registrations

message_pending

Custom message to include in emails for pending registrations

message_unpaid

Custom message to include in emails for unpaid registrations

moderation_enabled

Whether registrations must be approved by a manager

modification_end_dt

Datetime when the modification period is over

modification_mode

Whether registration modifications are allowed

property name
notification_sender_address

Notifications sender address

participant_list_disabled
principal_order = 2
principal_type = 8
publish_checkin_enabled

Whether checked-in status should be displayed in the event pages and participant list

publish_registration_count

Whether to display the number of registrations

publish_registrations_duration

For how long should the registrations be displayed after the event ends

publish_registrations_participants

Which registrations should be displayed in the private participant list

publish_registrations_public

Which registrations should be displayed in the public participant list

query: IndicoBaseQuery

A SQLAlchemy query for a model. Equivalent to db.session.query(Model). Can be customized per-model by overriding query_class.

Warning

The query interface is considered legacy in SQLAlchemy. Prefer using session.execute(select()) instead.

registration_limit

Maximum number of registrations allowed

registrations

The registrations associated with this form

render_base_price()
require_captcha

Whether to show captcha for users without an account

require_login

Whether users must be logged in to register

require_privacy_policy_agreement

Whether users must accept the event’s privacy policy when registering

require_user

Whether registrations must be associated with an Indico account

retention_period

period for which the registration itself should be kept

property sections
start_dt

Datetime when the registration form is open

ticket_google_wallet

Whether to allow exporting tickets to Google Wallet

ticket_on_email

Whether to send tickets by e-mail

ticket_on_event_page

Whether to show a ticket download link on the event homepage

ticket_on_summary_page

Whether to show a ticket download link on the registration summary page

ticket_template

The template used to generate tickets

ticket_template_id

The ID of the template used to generate tickets

tickets_enabled

Whether tickets are enabled for this form

tickets_for_accompanying_persons

Whether to create tickets for the registrant’s accompanying persons

title

The title of the registration form

class indico.modules.events.registration.models.invitations.InvitationState(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)
accepted = 1
declined = 2
pending = 0
class indico.modules.events.registration.models.invitations.RegistrationInvitation(**kwargs)

An invitation for someone to register.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

affiliation

The affiliation of the invited person

email

The email of the invited person

first_name

The first name of the invited person

id

The ID of the invitation

last_name

The last name of the invited person

locator

Define a smart locator property.

This behaves pretty much like a normal read-only property and the decorated function should return a dict containing the necessary data to build a URL for the object.

This decorator should usually be applied to a method named locator as this name is required for get_locator to find it automatically when just passing the object.

If you need more than one locator, you can define it like this:

@locator_property
def locator(self):
    return {...}

@locator.other
def locator(self):
    return {...}

The other locator can then be accessed by passing obj.locator.other to the code expecting an object with a locator.

query: IndicoBaseQuery

A SQLAlchemy query for a model. Equivalent to db.session.query(Model). Can be customized per-model by overriding query_class.

Warning

The query interface is considered legacy in SQLAlchemy. Prefer using session.execute(select()) instead.

registration

The associated registration

registration_form_id

The ID of the registration form

registration_id

The ID of the registration (if accepted)

skip_access_check

Whether the event access check should be skipped

skip_moderation

Whether registration moderation should be skipped

state

The state of the invitation

uuid

The UUID of the invitation

class indico.modules.events.registration.models.items.PersonalDataType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Description of the personal data items that exist on every registration form.

FIELD_DATA = [(PersonalDataType.first_name, {'input_type': 'text', 'position': 1, 'title': 'First Name'}), (PersonalDataType.last_name, {'input_type': 'text', 'position': 2, 'title': 'Last Name'}), (PersonalDataType.email, {'input_type': 'email', 'position': 3, 'title': 'Email Address'}), (PersonalDataType.affiliation, {'input_type': 'text', 'position': 4, 'title': 'Affiliation'}), (PersonalDataType.address, {'input_type': 'textarea', 'is_enabled': False, 'position': 1000, 'title': 'Address'}), (PersonalDataType.country, {'input_type': 'country', 'is_enabled': False, 'position': 1001, 'title': 'Country'}), (PersonalDataType.phone, {'input_type': 'phone', 'is_enabled': False, 'position': 1002, 'title': 'Phone Number'}), (PersonalDataType.position, {'input_type': 'text', 'is_enabled': False, 'position': 1003, 'title': 'Position'}), (PersonalDataType.title, {'data': {'choices': [{'caption': 'Mr', 'id': '44344269-54b2-4cff-916d-5a1feb1d962c', 'is_enabled': True, 'places_limit': 0, 'price': 0}, {'caption': 'Ms', 'id': '7fef1307-a7a9-4342-b090-2c7fb7873f96', 'is_enabled': True, 'places_limit': 0, 'price': 0}, {'caption': 'Mrs', 'id': '9beab6fb-8089-433e-a9ce-9248e8e4164b', 'is_enabled': True, 'places_limit': 0, 'price': 0}, {'caption': 'Dr', 'id': '47a2a985-9eae-4aef-87b7-9cbf978dfc01', 'is_enabled': True, 'places_limit': 0, 'price': 0}, {'caption': 'Prof.', 'id': '72c9be2c-92e2-4dad-89a6-8b27596a9fe6', 'is_enabled': True, 'places_limit': 0, 'price': 0}, {'caption': 'Mx', 'id': '6afeca4c-c508-4e54-bf3a-547925ed3efa', 'is_enabled': True, 'places_limit': 0, 'price': 0}], 'item_type': 'dropdown', 'with_extra_slots': False}, 'input_type': 'single_choice', 'is_enabled': False, 'position': 1004, 'title': 'Title'}), (PersonalDataType.picture, {'input_type': 'picture', 'is_enabled': False, 'position': 1005, 'title': 'Picture'})]
address = 6
affiliation = 4
property column

The Registration column in which the value is stored in addition to the regular registration data entry.

country = 8
email = 1
first_name = 2
get_title()
property is_required
last_name = 3
phone = 7
picture = 10
position = 9
title = 5
class indico.modules.events.registration.models.items.RegistrationFormItem(**kwargs)

Generic registration form item.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

get_locked_reason(registration)

Get the reason for the field being locked.

id

The ID of the object

input_type

input type of this field

property is_active
is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_field
is_label
is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

is_section
is_visible
log(*args, **kwargs)

Log with prefilled metadata for the item.

parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery

A SQLAlchemy query for a model. Equivalent to db.session.query(Model). Can be customized per-model by overriding query_class.

Warning

The query interface is considered legacy in SQLAlchemy. Prefer using session.execute(select()) instead.

registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

property view_data

Return object with data that the frontend can understand.

class indico.modules.events.registration.models.items.RegistrationFormItemType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)
field = 2
field_pd = 5
section = 1
section_pd = 4
text = 3
class indico.modules.events.registration.models.items.RegistrationFormPersonalDataSection(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

id

The ID of the object

input_type

input type of this field

is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

property own_data
parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery

A SQLAlchemy query for a model. Equivalent to db.session.query(Model). Can be customized per-model by overriding query_class.

Warning

The query interface is considered legacy in SQLAlchemy. Prefer using session.execute(select()) instead.

registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

class indico.modules.events.registration.models.items.RegistrationFormSection(**kwargs)

Registration form section that can contain fields and text.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

property active_fields
children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

property fields
id

The ID of the object

input_type

input type of this field

is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

property locator
property own_data
parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery

A SQLAlchemy query for a model. Equivalent to db.session.query(Model). Can be customized per-model by overriding query_class.

Warning

The query interface is considered legacy in SQLAlchemy. Prefer using session.execute(select()) instead.

registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

property view_data

Return object with data that the frontend can understand.

class indico.modules.events.registration.models.items.RegistrationFormText(**kwargs)

Text to be displayed in registration form sections.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

children
current_data

The latest value of the field

current_data_id

The ID of the latest data

data

unversioned field data

data_versions

The list of all versions of the field data

description

Description of this field

id

The ID of the object

input_type

input type of this field

is_deleted

Whether field has been “deleted”

is_enabled

Whether the field is enabled

is_manager_only

if the section is only accessible to managers

is_purged

Whether the registration data has been deleted due to an expired retention period

is_required

determines if the field is mandatory

property locator
parent_id

The ID of the parent form item

personal_data_type

The type of a personal data field

position
query: IndicoBaseQuery

A SQLAlchemy query for a model. Equivalent to db.session.query(Model). Can be customized per-model by overriding query_class.

Warning

The query interface is considered legacy in SQLAlchemy. Prefer using session.execute(select()) instead.

registration_form_id

The ID of the registration form

retention_period

period for which the registration data should be kept

title

The title of this field

type

The type of the registration form item

property view_data

Return object with data that the frontend can understand.

Utilities

class indico.modules.events.registration.util.ActionMenuEntry(text: str, icon_name: str, weight: int = 0, dialog_title: str = None, type: str = 'ajax-dialog', params: dict = <factory>, url: str = '', callback: str = '', requires_selected: bool = True, reload_page: bool = False, hide_if_locked: bool = False, extra_classes: str = '')
callback: str = ''
dialog_title: str = None
extra_classes: str = ''
hide_if_locked: bool = False
icon_name: str
params: dict
reload_page: bool = False
requires_selected: bool = True
text: str
type: str = 'ajax-dialog'
url: str = ''
weight: int = 0
class indico.modules.events.registration.util.RegistrationSchemaBase(*, only: Sequence[str] | AbstractSet[str] | None = None, exclude: Sequence[str] | AbstractSet[str] = (), many: bool = False, context: dict | None = None, load_only: Sequence[str] | AbstractSet[str] = (), dump_only: Sequence[str] | AbstractSet[str] = (), partial: bool | Sequence[str] | AbstractSet[str] | None = None, unknown: str | None = None)
class Meta
unknown = 'raise'
opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>
indico.modules.events.registration.util.build_registration_api_data(registration)
indico.modules.events.registration.util.build_registrations_api_data(event)
indico.modules.events.registration.util.check_registration_email(regform, email, registration=None, management=False)

Check whether an email address is suitable for registration.

Parameters:
  • regform – The registration form

  • email – The email address

  • registration – The existing registration (in case of modification)

  • management – If it’s a manager adding a new registration

indico.modules.events.registration.util.close_registration(regform)
indico.modules.events.registration.util.count_hidden_registrations(event, is_participant)

Get the number of hidden registrations for an event.

Parameters:
  • event – the Event to get registrations for

  • is_participant – whether the user accessing the registrations is a participant of the event

Returns:

number of registrations

indico.modules.events.registration.util.create_invitation(regform, user, email_from, email_subject, email_body, *, skip_moderation, skip_access_check)
indico.modules.events.registration.util.create_personal_data_fields(regform)

Create the special section/fields for personal data.

indico.modules.events.registration.util.create_registration(regform, data, invitation=None, management=False, notify_user=True, skip_moderation=None)
indico.modules.events.registration.util.diff_registration_data(old_data, new_data)

Compare two sets of registration data.

Returns:

A dictionary where the key is the html name of the field and the value is the old and new friendly data and the field price

indico.modules.events.registration.util.generate_spreadsheet_from_registrations(registrations, regform_items, static_items)

Generate a spreadsheet data from a given registration list.

Parameters:
  • registrations – The list of registrations to include in the file

  • regform_items – The registration form items to be used as columns

  • static_items – Registration form information as extra columns

indico.modules.events.registration.util.generate_ticket(registration)
indico.modules.events.registration.util.generate_ticket_qr_code(person)

Generate a Pillow Image with a QR Code encoding a check-in ticket.

Parameters:

registration – corresponding Registration object

indico.modules.events.registration.util.get_country_field(regform)

Get the country personal-data field of a regform.

indico.modules.events.registration.util.get_event_regforms(event, user, with_registrations=False, only_in_acl=False)

Get registration forms with information about user registrations.

Parameters:
  • event – the Event to get registration forms for

  • user – A User

  • with_registrations – Whether to return the user’s registration instead of just whether they have one

  • only_in_acl – Whether to include only registration forms that are in the event’s ACL

indico.modules.events.registration.util.get_event_regforms_registrations(event, user, include_scheduled=True, only_in_acl=False)

Get regforms and the associated registrations for an event+user.

Parameters:
  • event – the Event to get registration forms for

  • user – A User

  • include_scheduled – Whether to include scheduled but not open registration forms

  • only_in_acl – Whether to include only registration forms that are in the event’s ACL

Returns:

A tuple, which includes: - All registration forms which are scheduled, open or registered. - A dict mapping all registration forms to the user’s registration if they have one.

indico.modules.events.registration.util.get_events_registered(user, dt=None)

Get the IDs of events where the user is registered.

Parameters:
  • user – A User

  • dt – Only include events taking place on/after that date

Returns:

A set of event ids

indico.modules.events.registration.util.get_flat_section_positions_setup_data(regform)
indico.modules.events.registration.util.get_flat_section_setup_data(regform)
indico.modules.events.registration.util.get_flat_section_submission_data(regform, *, management=False, registration=None)
indico.modules.events.registration.util.get_form_registration_data(regform, registration, *, management=False)

Return a mapping from ‘html_field_name’ to the registration data. This also includes default values for any newly added fields since the React frontend requires all initial values to be present.

indico.modules.events.registration.util.get_initial_form_values(regform, *, management=False)
indico.modules.events.registration.util.get_persons(registrations, include_accompanying_persons=False)
indico.modules.events.registration.util.get_published_registrations(event, is_participant)

Get a list of published registrations for an event.

Parameters:
  • event – the Event to get registrations for

  • is_participant – whether the user accessing the registrations is a participant of the event

Returns:

list of Registration objects

indico.modules.events.registration.util.get_registered_event_persons(event)

Get all registered EventPersons of an event.

indico.modules.events.registration.util.get_registrations_with_tickets(user, event)
indico.modules.events.registration.util.get_ticket_attachments(registration)
indico.modules.events.registration.util.get_ticket_qr_code_data(person)

Get the data which will be saved in a ticket QR code.

QR code format:

{

‘i’: [qr_code_version, indico_url, b64(checkin_secret), b64(person_id)], # extra keys may be added by plugins (e.g. site access)

}

This format tries to be as compact as possible so that the resulting QR codes are small and easy to scan. However, we need to stick with a JSON dictionary in order to be compatible with the site access plugin which inserts an extra key with the ADaMS URL.

Note that person_id is only included if this is a ticket for an accompanying person.

The checkin secret and person id (if present) is base64-encoded to save space (see https://stackoverflow.com/a/53136913/3911147).

If Indico is running on HTTPS, the scheme (’https://’) is stripped from the URL to save a few extra bytes.

indico.modules.events.registration.util.get_title_uuid(regform, title)

Convert a string title to its UUID value.

If the title does not exist in the title PD field, it will be ignored and returned as None.

indico.modules.events.registration.util.get_user_data(regform, user, invitation=None)
indico.modules.events.registration.util.import_invitations_from_csv(regform, fileobj, email_from, email_subject, email_body, *, skip_moderation=True, skip_access_check=True, skip_existing=False)

Import invitations from a CSV file.

Returns:

A list of invitations and the number of skipped records which is zero if skip_existing=False

indico.modules.events.registration.util.import_registrations_from_csv(regform, fileobj, skip_moderation=True, notify_users=False)

Import event registrants from a CSV file into a form.

indico.modules.events.registration.util.import_user_records_from_csv(fileobj, columns)

Parse and do basic validation of user data from a CSV file.

Parameters:
  • fileobj – the CSV file to be read

  • columns – A list of column names, ‘first_name’, ‘last_name’, & ‘email’ are compulsory.

Returns:

A list dictionaries each representing one row, the keys of which are given by the column names.

indico.modules.events.registration.util.make_registration_schema(regform, *, management=False, override_required=False, registration=None, captcha_required=False)

Dynamically create a Marshmallow schema based on the registration form fields.

Parameters:
  • regform – The registration form

  • management – True if this registration is with manager privileges

  • override_required – True if the registration manager requested to override required fields

  • registration – The existing registration, if it exists

  • captcha_required – True if a captcha is present on the registration form

indico.modules.events.registration.util.modify_registration(registration, data, management=False, notify_user=True)
indico.modules.events.registration.util.serialize_registration_form(regform)

Serialize registration form to JSON-like object.

indico.modules.events.registration.util.snapshot_registration_data(registration)
indico.modules.events.registration.util.update_regform_item_positions(regform)

Update positions when deleting/disabling an item in order to prevent gaps.

Placeholders

class indico.modules.events.registration.placeholders.registrations.EventLinkPlaceholder
classmethod iter_param_info(**kwargs)

Yield information for known params.

Each item yielded must be a (value, description) tuple.

Parameters:

kwargs – arguments specific to the placeholder’s context

name = 'event_link'

The name of the placeholder. Must be unique within the context where the placeholder is used

param_friendly_name = 'link title'

The human-friendly name of the param

classmethod render(param, regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.EventTitlePlaceholder
description = l'The title of the event'

A short description of the placeholder.

name = 'event_title'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.FieldPlaceholder
advanced = True

Whether the placeholder should not be shown by default

description = None

A short description of the placeholder.

classmethod iter_param_info(regform, registration)

Yield information for known params.

Each item yielded must be a (value, description) tuple.

Parameters:

kwargs – arguments specific to the placeholder’s context

name = 'field'

The name of the placeholder. Must be unique within the context where the placeholder is used

param_required = True

Whether the param is required

param_restricted = True

Whether only params defined in iter_param_info are allowed

classmethod render(param, regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.FirstNamePlaceholder
description = l'First name of the person'

A short description of the placeholder.

name = 'first_name'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.IDPlaceholder
description = l'The ID of the registration'

A short description of the placeholder.

name = 'id'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.LastNamePlaceholder
description = l'Last name of the person'

A short description of the placeholder.

name = 'last_name'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.LinkPlaceholder
description = l'The link to the registration details'

A short description of the placeholder.

name = 'link'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.registrations.RejectionReasonPlaceholder
description = l'The reason why the registration was rejected'

A short description of the placeholder.

name = 'rejection_reason'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(regform, registration)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.invitations.EmailPlaceholder
description = l'Email of the person'

A short description of the placeholder.

name = 'email'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(invitation, **kwargs)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.invitations.FirstNamePlaceholder
description = l'First name of the person'

A short description of the placeholder.

name = 'first_name'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(invitation, **kwargs)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

class indico.modules.events.registration.placeholders.invitations.InvitationLinkPlaceholder
description = l'Link to accept/decline the invitation'

A short description of the placeholder.

name = 'invitation_link'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(invitation, **kwargs)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

required = True

Whether the placeholder must be used at least once.

class indico.modules.events.registration.placeholders.invitations.LastNamePlaceholder
description = l'Last name of the person'

A short description of the placeholder.

name = 'last_name'

The name of the placeholder. Must be unique within the context where the placeholder is used

classmethod render(invitation, **kwargs)

Convert the placeholder to a string.

When a placeholder contains HTML that should not be escaped, the returned value should be returned as a markupsafe.Markup instance instead of a plain string.

Subclasses are encouraged to explicitly specify the arguments they expect instead of using **kwargs.

Parameters:

kwargs – arguments specific to the placeholder’s context

Settings

class indico.modules.events.registration.settings.RegistrationSettingsProxy(module, defaults=None, strict=True, acls=None, converters=None)

Store per-event registration settings.

get_participant_list_columns(event, form=None)
get_participant_list_form_ids(event)
set_participant_list_columns(event, columns, form=None)
set_participant_list_form_ids(event, form_ids)

Statistics

class indico.modules.events.registration.stats.AccommodationStats(field)

Base class for registration form statistics.

Parameters:
  • title – str – the title for the stats box

  • subtitle – str – the subtitle for the stats box

  • type – str – the type used in Jinja to display the stats

class indico.modules.events.registration.stats.Cell(type='default', data=None, colspan=1, classes=None, qtip=None)

Hold data and type for a cell of a stats table.

The table below indicates the valid types and expected data.

type

data

str

str – string value

progress

(int, str) – a tuple with the progress (a value between 0 and 1) and a label

progress-stacked

([int], str) – a tuple with a list of progresses (values which must sum up to 1) and a label

currency

float – numeric value

icon

str – icon name from _icons.scss

default

None – renders a default cell with an &mdash; (use Cell(type=’str’) for an empty cell)

Parameters:
  • type – str – The type of data in the cell

  • data – The data for the cell

  • colspan – int – HTML colspan value for the cell

  • classes – [str] – HTML classes to apply to the cell

  • qtip – str – content for qtip

class indico.modules.events.registration.stats.DataItem(regs=0, attendance=0, capacity=0, billable=False, cancelled=False, price=0, fixed_price=False, paid=0, paid_amount=0, unpaid=0, unpaid_amount=0)

Hold the aggregation of some data, intended for stats tables as a aggregation from which to generate cells.

Parameters:
  • regs – int – number of registrant

  • attendance – int – number of people attending

  • capacity – int – maximum number of people allowed to attend (0 if unlimited)

  • billable – bool – whether the item is billable to the or not

  • cancelled – bool – whether the item is cancelled or not

  • price – str – the price of the item

  • fixed_price – bool – True if the price is per registrant, False if accompanying guests must pay as well.

  • paid – int – number of registrants who paid

  • paid_amount – float – amount already paid by registrants

  • unpaid – int – number of registrants who haven’t paid

  • unpaid_amount – float – amount not already paid by registrants

class indico.modules.events.registration.stats.FieldStats(field, **kwargs)

Hold stats for a registration form field.

get_table()

Return a table containing the stats for each item.

Returns:

dict – A table with a list of head cells (key: ‘head’) and a list of rows (key: ‘rows’) where each row is a list of cells.

property is_currency_shown
class indico.modules.events.registration.stats.OverviewStats(regform)

Generic stats for a registration form.

Base class for registration form statistics.

Parameters:
  • title – str – the title for the stats box

  • subtitle – str – the subtitle for the stats box

  • type – str – the type used in Jinja to display the stats

class indico.modules.events.registration.stats.StatsBase(title, subtitle, type, **kwargs)

Base class for registration form statistics.

Parameters:
  • title – str – the title for the stats box

  • subtitle – str – the subtitle for the stats box

  • type – str – the type used in Jinja to display the stats

property is_currency_shown