diff --git a/cps/__init__.py b/cps/__init__.py index 5ecc00eb..2b8808fa 100644 --- a/cps/__init__.py +++ b/cps/__init__.py @@ -84,7 +84,7 @@ app = Flask(__name__) app.config.update( SESSION_COOKIE_HTTPONLY=True, SESSION_COOKIE_SAMESITE='Strict', - REMEMBER_COOKIE_SAMESITE='Strict', # will be available in flask-login 0.5.1 earliest + REMEMBER_COOKIE_SAMESITE='Strict', WTF_CSRF_SSL_STRICT=False, SESSION_COOKIE_NAME=os.environ.get('COOKIE_PREFIX', "") + "session", REMEMBER_COOKIE_NAME=os.environ.get('COOKIE_PREFIX', "") + "remember_token" diff --git a/cps/editbooks.py b/cps/editbooks.py index 5f58cf81..c1f96df1 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -21,7 +21,7 @@ # along with this program. If not, see . import os -from datetime import datetime +from datetime import datetime, UTC import json from shutil import copyfile from uuid import uuid4 @@ -707,8 +707,8 @@ def create_book_on_upload(modify_date, meta): pubdate = datetime(101, 1, 1) # Calibre adds books with utc as timezone - db_book = db.Books(title, "", sort_authors, datetime.utcnow(), pubdate, - '1', datetime.utcnow(), path, meta.cover, db_author, [], "") + db_book = db.Books(title, "", sort_authors, datetime.now(UTC), pubdate, + '1', datetime.now(UTC), path, meta.cover, db_author, [], "") modify_date |= modify_database_object(input_authors, db_book.authors, db.Authors, calibre_db.session, 'author')