Q: Flask-Security: Custom registration form doesn't validate properly I have an app using Flask-Security where users need to enter additional information on registration. 
Based on the Flask-Security documentation I have created an ExtendedRegisterForm:
class ExtendedRegisterForm(RegisterForm):
    email = TextField('Email Address', [DataRequired()])
    password = PasswordField('Password', [DataRequired()])
    retype_password = PasswordField('Retype Password', [DataRequired()])
    name = TextField('Team Name', [DataRequired()])
    players = TextField('Players', [DataRequired()])

and have added it on Security initialisation:
security = Security(app, user_datastore, register_form=forms.ExtendedRegisterForm)

I have also updated my template to include the additional fields:
{{ register_user_form.hidden_tag() }}
{{ render_field_with_errors(register_user_form.email, class_="form-control") }}
{{ render_field_with_errors(register_user_form.password, class_="form-control") }}
{% if register_user_form.password_confirm %}
        {{ render_field_with_errors(register_user_form.password_confirm, class_="form-control") }}
{% endif %}
{{ render_field_with_errors(register_user_form.name, class_="form-control") }}
{{ render_field_with_errors(register_user_form.players, class_="form-control") }}
{{ render_field(register_user_form.submit,  class_="btn btn-default") }}

I am having an issue where when the user enters all their information and clicks submit, the page refreshes and the passwords disappear, but no validation errors are present. I can see in my flask log that it has correctly made a POST request, but it seems that Flask-Security is not receiving it correctly.
If I remove the DataRequired() validation in the form, then Flask-Security takes the POST request, but no longer checks whether an account with the email exists before adding a new one to the database.
Has anyone experienced this issue before, or do you have any suggestions on how to solve this issue?
Cheers,
John
EDIT: Here is my model:
class Team(db.Model):
    id = db.Column(db.Integer, primary_key = True)
    email = db.Column(db.String(120), unique = True)
    password = db.Column(db.String(255))
    active = db.Column(db.Boolean())
    name = db.Column(db.String(64), index = True, unique = True)
    players = db.Column(db.String(255))
    last_password_time = db.Column(db.DateTime)
    events = db.relationship('Event', secondary=events,
        backref=db.backref('teams', lazy='dynamic'))
    roles = db.relationship('Role', secondary=roles_users,
        backref=db.backref('teams', lazy='dynamic'))


A: Fixed. I forgot I didn't need to include fields already there.
Fix:
class ExtendedRegisterForm(RegisterForm):
    name = TextField('Team Name', [DataRequired()])
    players = TextField('Players', [DataRequired()])

