From cb578d09001a6f7ba04a9175e2e3f72f27934c74 Mon Sep 17 00:00:00 2001 From: Antoni Marroig Campomar Date: Tue, 14 Jan 2025 16:22:32 +0100 Subject: [PATCH] [17.0][FIX] bookstore_mgmt_google_books_api: Fix published_date without good format --- bookstore_mgmt_google_books_api/models/product_product.py | 2 +- bookstore_mgmt_google_books_api/models/product_template.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bookstore_mgmt_google_books_api/models/product_product.py b/bookstore_mgmt_google_books_api/models/product_product.py index ec60659..b6cf5c3 100644 --- a/bookstore_mgmt_google_books_api/models/product_product.py +++ b/bookstore_mgmt_google_books_api/models/product_product.py @@ -33,7 +33,7 @@ def action_import_from_isbn(self): book.published_date, "%Y-%m-%d" ).year except Exception: - published_year = book.published_date + published_year = int(book.published_date[:4]) data["year_edition"] = published_year diff --git a/bookstore_mgmt_google_books_api/models/product_template.py b/bookstore_mgmt_google_books_api/models/product_template.py index 73d5dde..223f134 100644 --- a/bookstore_mgmt_google_books_api/models/product_template.py +++ b/bookstore_mgmt_google_books_api/models/product_template.py @@ -77,7 +77,7 @@ def action_import_from_isbn(self): book.published_date, "%Y-%m-%d" ).year except Exception: - published_year = book.published_date + published_year = int(book.published_date[:4]) data["year_edition"] = published_year