#NEWLINE# @ auth . route ( '/register' , methods = [ 'GET' , 'POST' ] ) #NEWLINE# def register( ) : #NEWLINE# #INDENT# form = RegisterUserForm ( ) #NEWLINE# if form . validate_on_submit ( ) : #NEWLINE# #INDENT# user = User . create ( username = form . data [ 'username' ] , email = form . data [ 'email' ] , password = form . data [ 'password' ] , remote_addr = request . remote_addr ) #NEWLINE# s = URLSafeSerializer ( current_app . secret_key ) #NEWLINE# token = s . dumps ( user . id ) #NEWLINE# send_registration_email . delay ( s , token ) #NEWLINE# flash ( gettext ( 'Sent verification email to {email}' . format ( email = user . email ) ) , 'success' ) #NEWLINE# return redirect ( url_for ( 'index' ) ) #NEWLINE# #UNINDENT# return render_template ( 'register.html' , form = form )