def view_user(username): if model.given_name_return_id(username): wall_posts = model.wall_posts(username) return render_template("wall.html", wall_posts = wall_posts, username = username, user_id =session.get('id', None)) else: flash("Sorry, this user is not registered yet.") return redirect(url_for("index"))
def create_account(): username = request.form.get("username") password = request.form.get("password") if model.given_name_return_id(username): flash("You already have an account!") return redirect(url_for("index")) else: model.create_account(username, password) flash ("You have successfully created an account!") return redirect(url_for("index"))