d9d75093d36a2b4cff319446168aeb1af2dc77c3 — Krystian Chachuła 3 months ago c8fbb25
Make errors translatable
1 files changed, 3 insertions(+), 2 deletions(-)

M buyfriend/__init__.py
M buyfriend/__init__.py => buyfriend/__init__.py +3 -2
@@ 7,15 7,16 @@ from werkzeug.exceptions import HTTPException

from . import ads, auth, db, filters, translation, scrape
from .logging import log
from .translation import _

def handle_error(e):
    flash(e.description, "error")
    flash("%d: %s" % (e.code, e.name), "error")
    return render_template("base.html"), e.code

def unauthorized(e):
    flash(e.description, "warning")
    flash(_("You need to log in to view this page."), "warning")
    return redirect(url_for("auth.login"))