()
return render_template('register.html', form=form)
If new user registrations are enabled, provides a registration form
    and validation.
If new user registrations are enabled, provides a registration form
    and validation.
If new user registrations are enabled provides a registration form and validation .
def register():
    """
    If new user registrations are enabled, provides a registration form
    and validation.
    """
    if g.user:
        return redirect(url_for('public.landing'))

    # Make sure this instance is allowing new users.
    if not current_app.config.get('NOTIFICO_NEW_USERS', True):
        return redirect(url_for('public.landing'))

    form = UserRegisterForm()
    if form.validate_on_submit():
        # Checks out, go ahead and create our new user.
        u = User.new(form.username.data, form.email.data, form.password.data)
        db.session.add(u)
        db.session.commit()
        # ... and send them back to the login screen.
        return redirect(url_for('.login'))

    return render_template('register.html', form=form)
def register ( ) : if g . user : return redirect ( url_for ( 'public.landing' ) ) # Make sure this instance is allowing new users. if not current_app . config . get ( 'NOTIFICO_NEW_USERS' , True ) : return redirect ( url_for ( 'public.landing' ) ) form = UserRegisterForm ( ) if form . validate_on_submit ( ) : # Checks out, go ahead and create our new user. u = User . new ( form . username . data , form . email . data , form . password . data ) db . session . add ( u ) db . session . commit ( ) # ... and send them back to the login screen. return redirect ( url_for ( '.login' ) ) return render_template ( 'register.html' , form = form )