diff --git a/suchwow/app.py b/suchwow/app.py index 430dc0c..d988bbc 100644 --- a/suchwow/app.py +++ b/suchwow/app.py @@ -1,7 +1,7 @@ import json from os import makedirs -from flask import Flask, request, session -from flask import render_template, flash +from flask import Flask, request, session, redirect +from flask import render_template, flash, url_for from flask_session import Session from suchwow import config from suchwow.models import Post, Profile, Comment, Notification, db @@ -41,7 +41,8 @@ def about(): @app.errorhandler(404) def not_found(error): - return "nothin there, brah" + flash("nothing there, brah") + return redirect(url_for("index")) @app.cli.command("init") def init(): diff --git a/suchwow/routes/post.py b/suchwow/routes/post.py index 4c764e3..787496d 100644 --- a/suchwow/routes/post.py +++ b/suchwow/routes/post.py @@ -46,7 +46,8 @@ def read(id): transfers=transfers ) else: - return "no meme there brah" + flash("No meme there, brah") + return redirect(url_for("index")) @bp.route("/post/create", methods=["GET", "POST"]) @login_required