Making a user field not editable when ‘for all users’ is selected

AI-generated summary

In a discussion about making user fields non-editable after signup when the requirement is set to “For all users,” ppcole asks if this is possible. NateDhaliwal responds that it is not, as the checkbox cannot be unchecked, though setting the requirement to “On signup” is an alternative that excludes existing users. ppcole questions the design rationale, noting many use cases require fields to be uneditable yet mandatory for all. Canapin warns that modifying Discourse code to achieve this would require a custom plugin and advises against relying on AI-generated code for such tasks. JammyDodger suggests the editability might be intentional to allow pre-existing users to fill in the field, asking if the goal is to make fields uneditable only after the initial entry. Finally, NitroBrude shares a related meta topic regarding custom user fields that are required for all but editable only once.

Hello

Is there a way to make a User Field not editable after signup when the Field Requirement is set to “For all users”?

Thanks

I don’t think so. The checkbox cannot be unchecked.
You can use the ‘On signup’ instead, but existing users won’t be affected.

Thanks for your response @NateDhaliwal. I wonder what was the rational behind the current design decision. There are many usecases where one wants User Fields to be un-editable and set to For all users.

I’m not sure about what you’re asking, but if you’re thinking of modifying Discourse’s code to prevent user fields from being editable, it would require a plugin, and chatGPT is very, very bad at creating Discourse plugins. I would not rely on what chatGPT outputs.

I think it has to be editable so the users who have already signed up before you implement it can fill it in?

Are you thinking of a use case along the lines of ‘not editable once entered’?