From 63c16da8cf074d9053a4445583ab3c58415fa97c Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 9 Feb 2023 22:01:41 +0200 Subject: [PATCH] Remove commented code. --- backend/moonstreamapi/actions.py | 37 +------------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/backend/moonstreamapi/actions.py b/backend/moonstreamapi/actions.py index 41223861..fc87ec5e 100644 --- a/backend/moonstreamapi/actions.py +++ b/backend/moonstreamapi/actions.py @@ -622,44 +622,9 @@ def get_entity_subscription_collection_id( create_if_not_exist: bool = False, ) -> Optional[str]: """ - Get collection_id from brood resources. + Get collection_id from brood resources. If collection not exist and create_if_not_exist is True """ - # try: - # collections: EntityCollectionsResponse = ec.list_collections(token=token) - # except EntityUnexpectedResponse as e: - # logger.error(f"Error get collection, error: {str(e)}") - # raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail) - # except Exception as e: - # logger.error(f"Error get collection, error: {str(e)}") - # raise MoonstreamHTTPException(status_code=500, internal_error=e) - - # # list resources - - # available_collections: Dict[str, str] = { - # collection.name: collection.collection_id - # for collection in collections.collections - # } - - # if collection_name not in available_collections: - - # if create_if_not_exist: - # try: - - # collection: EntityCollectionResponse = ec.add_collection( - # token=token, name=collection_name - # ) - # collection_id = collection.collection_id - # except EntityUnexpectedResponse as e: - # logger.error(f"Error get collection, error: {str(e)}") - # raise MoonstreamHTTPException( - # status_code=e.status_code, detail=e.detail - # ) - # else: - # raise EntityCollectionNotFoundException("Collection not found.") - # else: - # collection_id = available_collections[collection_name] - params = { "type": resource_type, "user_id": str(user_id),