diff --git a/app/errors/handlers.py b/app/errors/handlers.py index eaa52bc1..6c798569 100644 --- a/app/errors/handlers.py +++ b/app/errors/handlers.py @@ -14,3 +14,9 @@ from app.errors import bp def internal_error(error): db.session.rollback() return render_template('errors/500.html'), 500 + + +@bp.app_errorhandler(401) +def internal_error(error): + db.session.rollback() + return render_template('errors/401.html'), 401 \ No newline at end of file diff --git a/app/templates/errors/401.html b/app/templates/errors/401.html new file mode 100644 index 00000000..115eb36d --- /dev/null +++ b/app/templates/errors/401.html @@ -0,0 +1,21 @@ +{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') %} + {% extends 'themes/' + theme() + '/base.html' %} +{% else %} + {% extends "base.html" %} +{% endif %} %} + +{% block app_content %} +
+
+
+
+

{{ _('Sorry, access is denied') }}

+
+
+

{{ _('You cannot access this area.') }}

+

{{ _('Back') }}

+
+
+
+
+{% endblock %}