You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
I understand that flask-user allows users with various roles to login. Based on the different roles that are available to users, each user can access routes that are available to that user and role.
However, I am trying to set up multiple registration pages for each user-role.
E.g. users with admin role have one signup page which asks for a lot of information up front , whereas users with regular role will have a simplified signup page just asking for basic details.
How can this be achieved using flask-user.
One good example would be Employers and Candidates on a job portal. How can we have 2 different forms - one for employers to sign up and another one for candidate sign up .
Both the employers and candidates will go into the users table - but when their individual registration forms are filled out - they will have different roles - in the user-roles table ?
Thanks
The text was updated successfully, but these errors were encountered:
I tend to ask as little info as possible for people to sign up (to avoid users bailing because it asks for too much info). Then, on the first time they log in, I ask for the required additional info.
To do this, I present them with the same (short) register form.
Then in an @app.before_request function:
I check the user's role
Check if required info has been supplied
If not: Present a different UserProfile form for each role
Have required fields in each form, so that a user must fill those fields in before they can continue to use the website.
If this doesn't work for you, you can offer regular users with the standard Flask-User register form.
For Admin users you'll need to add your own register_admin() view function that copies Flask-User's register() function and supply your own custom RegisterAdminForm to that view.
Hello
I understand that flask-user allows users with various roles to login. Based on the different roles that are available to users, each user can access routes that are available to that user and role.
However, I am trying to set up multiple registration pages for each user-role.
E.g. users with admin role have one signup page which asks for a lot of information up front , whereas users with regular role will have a simplified signup page just asking for basic details.
How can this be achieved using flask-user.
One good example would be Employers and Candidates on a job portal. How can we have 2 different forms - one for employers to sign up and another one for candidate sign up .
Both the employers and candidates will go into the users table - but when their individual registration forms are filled out - they will have different roles - in the user-roles table ?
Thanks
The text was updated successfully, but these errors were encountered: