def index(): try: token = add_token(helper.token) reviews = Reviews.list_all_reviews() return template("layout", my_top=0, reviews = reviews, token = token ) except MySQLdb.OperationalError ,e: redirect("/index")
def login_form(): try: user_details = logged_in_user() start_point = 1 reviews = Reviews.list_all_reviews() if not user_details: token = add_token(helper.token) return template("alogin", my_top=1, cond=0,token=token) else: return template("layout",my_top=user_details["username"], reviews=reviews) except MySQLdb.OperationalError ,e: redirect("/index")
def get_edit_user_form(): try: user_details = logged_in_user() if user_details: email = user_details['email'] username = user_details['username'] token = add_token(helper.token) return template("edit_user", my_top = 0, token=token, email=email, username=username) else: redirect("/login") except MySQLdb.OperationalError ,e: redirect("/login")
def get_user_form(): token = add_token(helper.token) my_top, my_bottom = 1 , 1 return template("user_registration_form", title="Maamariga", my_top = my_top, cond = 0, my_bottom=my_bottom, token=token )