Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@SegiNyn
Copy link
Contributor

@SegiNyn SegiNyn commented Oct 1, 2025

Some preamble: this branch is not up to date with the latest master and since rebasing it will have a lot of conflicts, I would rather wait until I get a little bit more clarity on some things before doing so. Also, I was supposed to put the move of the registration module in a separate PR, but I haven't done so yet since it's still not clear if it's the registrations or only registration forms that should go to a different module. In this PR, it is the registrations that's been moved to a different module. (I tried moving only the registration forms at first but it resulted in similar things being found in 2 places). I will eventually create that move PR once this question has been answered.

This PR adds minimal features from the Event registration section into the category: A new registrations section in the category. Option for creating/deleting/editing registration form. Configuring registration form fields and setting the privacy and data retention settings. And then reusing the forms at the events.

Some screenshots: They look the same as the registration forms in the event section.

No registration form at category:

Screenshot 2025-10-01 at 10 29 44

One or more registration forms in the category

Screenshot 2025-10-01 at 10 30 08
creating a new regform Screenshot 2025-10-01 at 10 30 50

If create from template was selected:

Screenshot 2025-10-01 at 10 31 41

@OmeGak, could you please take a first look?

@github-actions github-actions bot added the alembic Contains database changes label Oct 1, 2025
__titles__ = (None, _('Category'), _('Events'), _('Management'))
category = 1
events = 2
management = 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By looking at how we use CategoryLogRealm, I don't see the need to add a management attribute. It should be ok to use CategoryLogRealm.category in all cases.

return RegistrationFormPrincipalSchema(many=True).jsonify(self.event.registration_forms)


class RHAPIEventSessionBlocks(RHProtectedEventBase):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this RH is used in the registration form, it's entirely related to an event context. I wonder if we should still have a indico.modules.events.registrations module, where some of the event-specific registration code lives.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is used for fetching data for use in the timetable sessions field of the registration from, I think it's ok to belong in the registrations module.

Btw this is related to the question I've asked at the description of this pr and also to @ThiefMaster on matrix, on how much to move to a different module. So let me know if you have a strong opinion about having registrations stuff under 2 modules or not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say this should stay in the event...

FWIW my initial understanding was that the only thing you're going to move out from modules/events/registration would be:

  • RHs for form management
  • react components
  • possibly models that are not specific to events (or turning some of them into mixins to be used in the actual models such as Registration within the event)

but not ALL the registration logic...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've move back almost ALL the registration logic...keeping only those required by the registration form

<a href="" class="i-button icon-plus arrow js-dropdown"
title="Create form"
data-toggle="dropdown">
Create form
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

{% block create_form_button %}
{% if event is defined %}
<a href="" class="i-button icon-plus arrow js-dropdown"
title="Create form"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

new_form = RegistrationForm(event=event, title=title, cloned_from=regform,
**{attr: getattr(regform, attr) for attr in attrs})
cloner._clone_form_items(regform, new_form, False)
signals.event.registration.after_registration_form_clone.send(regform, new_form=new_form)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need to send this signal. We are sending signals.event.registration_form_created right after calling clone_from_template_regform().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sending that signal because after the normal creation of a regform that signal is sent, plus we do use this signal in the plugin to add extra settings after a regform has been created and other plugins might as well

@SegiNyn SegiNyn force-pushed the registration-form-templates-two branch from 60c86e6 to 12e2282 Compare October 23, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alembic Contains database changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants