diff --git a/ted_sws/core/model/notice.py b/ted_sws/core/model/notice.py index edd1f5e5..ffa37aa8 100644 --- a/ted_sws/core/model/notice.py +++ b/ted_sws/core/model/notice.py @@ -479,10 +479,7 @@ def update_status_to(self, new_status: NoticeStatus): :return: """ if type(new_status) is not NoticeStatus: - raise ValueError(f"Status must be a NoticeStatus") - - print("Current status is :", self._status) - print("New status is :", new_status) + raise ValueError("Status must be a NoticeStatus") if self._status < new_status: if new_status in NOTICE_STATUS_DOWNSTREAM_TRANSITION[self._status]: @@ -510,5 +507,3 @@ def update_status_to(self, new_status: NoticeStatus): if new_status < NoticeStatus.PACKAGED: self.remove_lazy_field(Notice.mets_manifestation) self._mets_manifestation = None - - print("Updated status is :", self._status) diff --git a/ted_sws/data_manager/adapters/manifestation_repository.py b/ted_sws/data_manager/adapters/manifestation_repository.py index 633e62c2..e437d095 100644 --- a/ted_sws/data_manager/adapters/manifestation_repository.py +++ b/ted_sws/data_manager/adapters/manifestation_repository.py @@ -10,7 +10,8 @@ from ted_sws.data_manager.adapters.repository_abc import ManifestationRepositoryABC MONGODB_COLLECTION_ID = "_id" -FILE_STORAGE_COLLECTION_NAME = "fs.files" +MANIFESTATION_GRID_FS_COLLECTION_NAME = "manifestations_fs" +FILE_STORAGE_COLLECTION_NAME = f"{MANIFESTATION_GRID_FS_COLLECTION_NAME}.files" MANIFESTATION_ID = "manifestation_id" OBJECT_DATA_KEY = "object_data" AGGREGATE_REFERENCE_ID = "ted_id" @@ -26,7 +27,7 @@ def __init__(self, mongodb_client: MongoClient, database_name: str = None): self._database_name = database_name self.mongodb_client = mongodb_client db = mongodb_client[self._database_name] - self.file_storage = gridfs.GridFS(db) # TODO: Investigate how it works in multiple processes in parallel. + self.file_storage = gridfs.GridFS(db, collection=MANIFESTATION_GRID_FS_COLLECTION_NAME) # TODO: Investigate how it works in multiple processes in parallel. self.collection = db[self._collection_name] self.collection.create_index([(AGGREGATE_REFERENCE_ID, ASCENDING)]) self.file_storage_collection = db[FILE_STORAGE_COLLECTION_NAME]