Chris Miles avatar 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>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.