mirror of
https://github.com/janeczku/calibre-web
synced 2024-10-31 23:26:20 +00:00
Fixes from tests
This commit is contained in:
parent
fa95d064ff
commit
d5ed5cd665
6
cps.py
6
cps.py
@ -41,6 +41,7 @@ from cps.shelf import shelf
|
|||||||
from cps.admin import admi
|
from cps.admin import admi
|
||||||
from cps.gdrive import gdrive
|
from cps.gdrive import gdrive
|
||||||
from cps.editbooks import editbook
|
from cps.editbooks import editbook
|
||||||
|
from cps.error_handler import init_errorhandler
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from cps.kobo import kobo, get_kobo_activated
|
from cps.kobo import kobo, get_kobo_activated
|
||||||
@ -58,13 +59,16 @@ except ImportError:
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
app = create_app()
|
app = create_app()
|
||||||
|
|
||||||
|
init_errorhandler()
|
||||||
|
|
||||||
app.register_blueprint(web)
|
app.register_blueprint(web)
|
||||||
app.register_blueprint(opds)
|
app.register_blueprint(opds)
|
||||||
app.register_blueprint(jinjia)
|
app.register_blueprint(jinjia)
|
||||||
app.register_blueprint(about)
|
app.register_blueprint(about)
|
||||||
app.register_blueprint(shelf)
|
app.register_blueprint(shelf)
|
||||||
app.register_blueprint(admi)
|
app.register_blueprint(admi)
|
||||||
if config.config_use_google_drive:
|
# if config.config_use_google_drive:
|
||||||
app.register_blueprint(gdrive)
|
app.register_blueprint(gdrive)
|
||||||
app.register_blueprint(editbook)
|
app.register_blueprint(editbook)
|
||||||
if kobo_available:
|
if kobo_available:
|
||||||
|
@ -1327,7 +1327,7 @@ def import_ldap_users():
|
|||||||
try:
|
try:
|
||||||
new_users = services.ldap.get_group_members(config.config_ldap_group_name)
|
new_users = services.ldap.get_group_members(config.config_ldap_group_name)
|
||||||
except (services.ldap.LDAPException, TypeError, AttributeError, KeyError) as e:
|
except (services.ldap.LDAPException, TypeError, AttributeError, KeyError) as e:
|
||||||
log.exception(e)
|
log.debug_or_exception(e)
|
||||||
showtext['text'] = _(u'Error: %(ldaperror)s', ldaperror=e)
|
showtext['text'] = _(u'Error: %(ldaperror)s', ldaperror=e)
|
||||||
return json.dumps(showtext)
|
return json.dumps(showtext)
|
||||||
if not new_users:
|
if not new_users:
|
||||||
@ -1355,7 +1355,7 @@ def import_ldap_users():
|
|||||||
try:
|
try:
|
||||||
user_data = services.ldap.get_object_details(user=user_identifier, query_filter=query_filter)
|
user_data = services.ldap.get_object_details(user=user_identifier, query_filter=query_filter)
|
||||||
except AttributeError as e:
|
except AttributeError as e:
|
||||||
log.exception(e)
|
log.debug_or_exception(e)
|
||||||
continue
|
continue
|
||||||
if user_data:
|
if user_data:
|
||||||
user_login_field = extract_dynamic_field_from_filter(user, config.config_ldap_user_object)
|
user_login_field = extract_dynamic_field_from_filter(user, config.config_ldap_user_object)
|
||||||
|
@ -48,6 +48,7 @@ def internal_error(error):
|
|||||||
instance=config.config_calibre_web_title
|
instance=config.config_calibre_web_title
|
||||||
), 500
|
), 500
|
||||||
|
|
||||||
|
def init_errorhandler():
|
||||||
# http error handling
|
# http error handling
|
||||||
for ex in default_exceptions:
|
for ex in default_exceptions:
|
||||||
if ex < 500:
|
if ex < 500:
|
||||||
|
@ -28,7 +28,7 @@ from functools import wraps
|
|||||||
from flask import Blueprint, request, render_template, Response, g, make_response, abort
|
from flask import Blueprint, request, render_template, Response, g, make_response, abort
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
from sqlalchemy.sql.expression import func, text, or_, and_
|
from sqlalchemy.sql.expression import func, text, or_, and_
|
||||||
|
from werkzeug.security import check_password_hash
|
||||||
|
|
||||||
from . import constants, logger, config, db, calibre_db, ub, services, get_locale, isoLanguages
|
from . import constants, logger, config, db, calibre_db, ub, services, get_locale, isoLanguages
|
||||||
from .helper import get_download_link, get_book_cover
|
from .helper import get_download_link, get_book_cover
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="btn btn-default emailconfig"><a id="basic_config" href="{{url_for('admin.configuration')}}">{{_('Edit Basic Configuration')}}</a></div>
|
<div class="btn btn-default emailconfig" id="admin_edit_email"><a href="{{url_for('admin.edit_mailsettings')}}">{{_('Edit E-mail Server Settings')}}</a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user