I have added a field to the RegisterForm of flask security and the field is being rendered on the register page. The modified form is as follows-
class Registerform_roles(RegisterForm):
role = SelectField(label="Role", \
validators=[
validators.data_required(),
unique_identity_attribute
],\
choices=['a','b','c']
)
I want the values from this field to be saved to a different table in the datastore instead of the User table whenever the form is submitted. I wasn't able to find the part of the code that handles the post request from the register page. Any ideas on how to do this?
One thing to try is to set up a signal handler for 'user_registered' - that will receive the entire form as well as the User that was just registered.