From a3691cf7f3e2d6b491758d612b8069322c6bcb06 Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Tue, 18 Jun 2024 09:34:30 -0400 Subject: [PATCH 1/2] Return the real shelf title --- cps/editbooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/editbooks.py b/cps/editbooks.py index ed7dba0f3..08aff9a4f 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -362,8 +362,8 @@ def create_shelf(current_user_name=None, shelf_title=None): except Exception as ex: ub.session.rollback() log.error("Error occurred: %s", ex) - - resp = {"shelf_id": shelf_id} + + resp = {"shelf_id": shelf_id, "shelf_title": shelf_title} return resp log.info("Received metadata request: %s", request.args) From cad752298d993852de7835c9361d90e57d6a83c0 Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Tue, 18 Jun 2024 09:40:33 -0400 Subject: [PATCH 2/2] Update the shelf title when not unique --- cps/tasks/metadata_extract.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cps/tasks/metadata_extract.py b/cps/tasks/metadata_extract.py index be3963532..d0f86622e 100644 --- a/cps/tasks/metadata_extract.py +++ b/cps/tasks/metadata_extract.py @@ -84,6 +84,7 @@ def _send_shelf_title(self): response = requests.get(self.original_url, params={"current_user_name": self.current_user_name, "shelf_title": self.shelf_title}) if response.status_code == 200: self.shelf_id = response.json()["shelf_id"] + self.shelf_title = response.json()["shelf_title"] else: log.error("Received unexpected status code %s while sending the shelf title to %s", response.status_code, self.original_url) except Exception as e: