Changed error page to display logout route in case of unconfigured
This commit is contained in:
parent
b0f48b7f00
commit
1b7e422772
|
@ -35,6 +35,7 @@ def error_http(error):
|
||||||
error_code="Error {0}".format(error.code),
|
error_code="Error {0}".format(error.code),
|
||||||
error_name=error.name,
|
error_name=error.name,
|
||||||
issue=False,
|
issue=False,
|
||||||
|
unconfigured=not config.db_configured,
|
||||||
instance=config.config_calibre_web_title
|
instance=config.config_calibre_web_title
|
||||||
), error.code
|
), error.code
|
||||||
|
|
||||||
|
@ -44,6 +45,7 @@ def internal_error(error):
|
||||||
error_code="Internal Server Error",
|
error_code="Internal Server Error",
|
||||||
error_name=str(error),
|
error_name=str(error),
|
||||||
issue=True,
|
issue=True,
|
||||||
|
unconfigured=False,
|
||||||
error_stack=traceback.format_exc().split("\n"),
|
error_stack=traceback.format_exc().split("\n"),
|
||||||
instance=config.config_calibre_web_title
|
instance=config.config_calibre_web_title
|
||||||
), 500
|
), 500
|
||||||
|
|
|
@ -27,6 +27,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-offset-4 text-left">
|
<div class="col-md-offset-4 text-left">
|
||||||
|
{% if unconfigured %}
|
||||||
|
<div>{{_('Calibre-Web Instance is unconfigured, please contact your administrator')}}</div>
|
||||||
|
{% endif %}
|
||||||
{% for element in error_stack %}
|
{% for element in error_stack %}
|
||||||
<div>{{ element }}</div>
|
<div>{{ element }}</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -39,13 +42,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<div class="row">
|
||||||
<div class="row">
|
<div class="col errorlink">
|
||||||
<div class="col errorlink">
|
{% if not unconfigured %}
|
||||||
<a href="{{url_for('web.index')}}" title="{{ _('Return to Home') }}">{{_('Return to Home')}}</a>
|
<a href="{{url_for('web.index')}}" title="{{ _('Return to Home') }}">{{_('Return to Home')}}</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{{url_for('web.logout')}}" title="{{ _('Logout User') }}">{{ _('Logout User') }}</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user