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