Commits

Chris Miles committed 3ee09f1

Use Flash messages during registration & email activation.

Comments (0)

Files changed (2)

chronr/chronr/controllers/account.py

                 
                 Session.commit()
                 
+                h.flash_info(u"A confirmation email has been sent to %s containing a link to activate your account." %(user.email_address,))
                 redirect_to(url('/'))
         
         c.register_user_form = register_user_form
                         success = True
         
         if success:                    
-            c.message = u"Your account has been activated.  You may now login with username '%s'" %(user.user_name)
+            h.flash_ok(u"Your account has been activated.  You may now login with username '%s'" %(user.user_name))
         else:
-            c.message = u"Activation failed. The specified username or key may not be correct."
+            h.flash_alert(u"Activation failed. The specified username or key may not be correct.")
         
-        # TODO: use a Flash message and redirect to "/" or login page
-        
-        return render('/account/activation.mako')
+        redirect_to("/account/login")
     
 

chronr/chronr/templates/account/activation.mako

-<%inherit file="/base/base-index.mako"/>
-
-<%def name="title()">Account Activation</%def>
-
-<p>
-  ${c.message}
-</p>
-
-<%def name="rightcontent()">
-</%def>