Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in general: is it possible to remove firstname, lastname, username from the User entity ? #2267

Open
AttaM1rza opened this issue Aug 23, 2024 · 1 comment

Comments

@AttaM1rza
Copy link

AttaM1rza commented Aug 23, 2024

I want to make the registration process easy as possible, by removing unesseccary information.
I can add my own attributes like phone_number by creating a new class and inheriting from User, but the problem is:

>>> I dont need firstname, lastname and username... How can I change the User entity ?

I saw that these variables are used all over the codebase (for example in the login route, registration route, regsistrationUserModel, ...)

I thought of using a custom form and add_post(self, item) to overwrite the firstname, lastname, username, with the provided user email before persiting to the datasbase ... but is there a better (cleaner) way ?

@Yoyasp
Copy link
Contributor

Yoyasp commented Sep 7, 2024

You could override the user_model variable in a custom security manager. However i doubt it is worth the effort, first and last name are optional i believe, so why not just let users enter it if they want to, but ignore in all your custom application code

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

No branches or pull requests

2 participants