1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-06-16 18:29:57 +00:00

Show error message if user is missing download permission for kobo sync

This commit is contained in:
Ozzie Isaacs 2023-12-26 09:31:23 +01:00
parent 3aa75ef4a7
commit d272f43424

View File

@ -137,10 +137,13 @@ def convert_to_kobo_timestamp_string(timestamp):
@kobo.route("/v1/library/sync") @kobo.route("/v1/library/sync")
@requires_kobo_auth @requires_kobo_auth
@download_required # @download_required
def HandleSyncRequest(): def HandleSyncRequest():
if not current_user.role_download():
log.info("User needs download permissions for syncing library with Kobo")
return abort(403)
sync_token = SyncToken.SyncToken.from_headers(request.headers) sync_token = SyncToken.SyncToken.from_headers(request.headers)
log.info("Kobo library sync request received.") log.info("Kobo library sync request received")
log.debug("SyncToken: {}".format(sync_token)) log.debug("SyncToken: {}".format(sync_token))
log.debug("Download link format {}".format(get_download_url_for_book('[bookid]','[bookformat]'))) log.debug("Download link format {}".format(get_download_url_for_book('[bookid]','[bookformat]')))
if not current_app.wsgi_app.is_proxied: if not current_app.wsgi_app.is_proxied: