From 25f608d10946fbabb65d7e348564a9a313eb1540 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Thu, 7 Oct 2021 19:53:32 +0200 Subject: [PATCH] Bugfixes from testrun (load images from gdrive) Fix locale for new users --- cps/admin.py | 4 +- cps/gdrive.py | 4 +- cps/templates/user_edit.html | 4 +- cps/web.py | 2 +- test/Calibre-Web TestSummary_Linux.html | 1731 +++++++---------------- 5 files changed, 508 insertions(+), 1237 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index 740db680..1d2b7dc8 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -1352,8 +1352,6 @@ def _handle_new_user(to_save, content, languages, translations, kobo_support): languages=languages, title=_(u"Add new user"), page="newuser", kobo_support=kobo_support, registered_oauth=oauth_check) try: - content.default_language = config.config_default_language - content.locale = config.config_default_locale content.allowed_tags = config.config_allowed_tags content.denied_tags = config.config_denied_tags content.allowed_column_value = config.config_allowed_column_value @@ -1491,6 +1489,8 @@ def new_user(): else: content.role = config.config_default_role content.sidebar_view = config.config_default_show + content.locale = config.config_default_locale + content.default_language = config.config_default_language return render_title_template("user_edit.html", new_user=1, content=content, translations=translations, languages=languages, title=_(u"Add new user"), page="newuser", kobo_support=kobo_support, registered_oauth=oauth_check) diff --git a/cps/gdrive.py b/cps/gdrive.py index e2d8f166..267607de 100644 --- a/cps/gdrive.py +++ b/cps/gdrive.py @@ -21,7 +21,6 @@ # along with this program. If not, see . import os -import sys import hashlib import json import tempfile @@ -33,7 +32,7 @@ from flask import Blueprint, flash, request, redirect, url_for, abort from flask_babel import gettext as _ from flask_login import login_required -from . import logger, gdriveutils, config, ub, calibre_db +from . import logger, gdriveutils, config, ub, calibre_db, csrf from .admin import admin_required gdrive = Blueprint('gdrive', __name__, url_prefix='/gdrive') @@ -117,6 +116,7 @@ def revoke_watch_gdrive(): return redirect(url_for('admin.db_configuration')) +@csrf.exempt @gdrive.route("/watch/callback", methods=['GET', 'POST']) def on_received_watch_confirmation(): if not config.config_google_drive_watch_changes_response: diff --git a/cps/templates/user_edit.html b/cps/templates/user_edit.html index d48ba9a2..a250c246 100644 --- a/cps/templates/user_edit.html +++ b/cps/templates/user_edit.html @@ -33,7 +33,7 @@ @@ -42,7 +42,7 @@