#NEWLINE# def _register( self , username , email , password ) : #NEWLINE# #INDENT# user = User ( username = username , email = email , password = password ) #NEWLINE# self . request . db . add ( user ) #NEWLINE# activation = Activation ( ) #NEWLINE# self . request . db . add ( activation ) #NEWLINE# user . activation = activation #NEWLINE# self . request . db . flush ( ) #NEWLINE# message = activation_email ( self . request , user ) #NEWLINE# mailer . send . delay ( ** message ) #NEWLINE# self . request . session . flash ( jinja2 . Markup ( _ ( "Thank you for creating an account! We've sent you an email with an activation link, before you can sign in <strong>please check your email and open the link to activate your account</strong>." ) ) , 'success' ) #NEWLINE# self . request . registry . notify ( RegistrationEvent ( self . request , user ) )