401 error handler page #78

This commit is contained in:
rimu 2024-05-26 13:59:31 +12:00
parent bbf345e689
commit e35a5da500
2 changed files with 27 additions and 0 deletions

View file

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

View file

@ -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 %}
<div class="row">
<div class="col">
<div class="card">
<div class="card-header">
<h3 class="card-title">{{ _('Sorry, access is denied') }}</h3>
</div>
<div class="card-body">
<p>{{ _('You cannot access this area.') }}</p>
<p><a href="#" class="go_back">{{ _('Back') }}</a></p>
</div>
</div>
</div>
</div>
{% endblock %}