Disabling fields of registration form

Hello,
i’m trying to disable some fields inside the registration form. I dont want name/surname/email to be editable. I was trying to build a plugin to do that and hook to to registration_form_created but the hook is not called. My code.

class RegistrationPlugin(IndicoPlugin):
    configurable = True

    def _registration_form_created(self, *args, **kwargs):
        print("_registration_form_created")

    def _registration_checkin_updated(self, *args, **kwargs):
        print("_registration_checkin_updated")
    
    def _registration_created(self, *args, **kwargs):
        print("_registration_created")
    
    def _registration_deleted(self, *args, **kwargs):
        print("_registration_deleted")
    
    def _registration_form_created(self, *args, **kwargs):
        print("_registration_form_created")
    
    def _registration_form_deleted(self, *args, **kwargs):
        print("_registration_form_deleted")
    
    def _registration_form_edited(self, *args, **kwargs):
        print("_registration_form_edited")
    
    def _registration_form_wtform_created(self, *args, **kwargs):
        print("_registration_form_wtform_created")
    
    def _registration_personal_data_modified(self, *args, **kwargs):
        print("_registration_personal_data_modified")
    
    def _registration_state_updated(self, *args, **kwargs):
        print("_registration_state_updated")
    
    def _registration_updated(self, *args, **kwargs):
        print("_registration_updated")

    def init(self):
        super().init()
        self.connect(registration_form_created, self._registration_form_created)
        self.connect(registration_checkin_updated, self._registration_checkin_updated)
        self.connect(registration_created, self._registration_created)
        self.connect(registration_deleted, self._registration_deleted)
        self.connect(registration_form_deleted, self._registration_form_deleted)
        self.connect(registration_form_edited, self._registration_form_edited)
        self.connect(registration_form_wtform_created, self._registration_form_wtform_created)
        self.connect(registration_personal_data_modified, self._registration_personal_data_modified)
        self.connect(registration_state_updated, self._registration_state_updated)
        self.connect(registration_updated, self._registration_updated)

Any hint?

registration_form_created should be called when you create a new registration form in the event. It’s NOT used e.g. when a new user registers. If it’s not being called in that case, double-check that your plugin is loaded.

Also note that registration_form_wtform_created is obsolete (registration forms no longer use wtforms) and we just forgot to remove it.

PS: I’m not sure if what you are trying to do will work at all, unless you somehow inject the now-missing form data so validation during submission doesn’t fail.

I just want to make those field not editable by the user. The plugin is loaded since init() is called but the event is not firing when the registration form pops up.

You misunderstood how this signal works. It is triggered when the RegistrationForm database object is created (ie when you create a new “registration form” in the event management area).

There is no signal that can do what you are trying to do.