nicer 404 and missing page redirects

graphs-n-shit
lza_menace 4 years ago
parent f655943898
commit fa0a6461d4

@ -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():

@ -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