jack 1 개월 전
부모
커밋
324f175889
2개의 변경된 파일16개의 추가작업 그리고 5개의 파일을 삭제
  1. 8 2
      py/core/main/api/v3/collections_router.py
  2. 8 3
      py/core/main/api/v3/documents_router.py

+ 8 - 2
py/core/main/api/v3/collections_router.py

@@ -157,11 +157,15 @@ class CollectionsRouter(BaseRouterV3):
             with a specified name and optional description. The user creating
             the collection is automatically added as a member.
             """
-            user_collections_count = (
+            logger.info(f"Creating collection {name}")
+            user_collections_count = 0
+            '''
+            (
                 await self.services.management.collections_overview(
                     user_ids=[auth_user.id], limit=1, offset=0
                 )
             )["total_entries"]
+            '''
             user_max_collections = (
                 await self.services.management.get_user_max_collections(
                     auth_user.id
@@ -172,6 +176,7 @@ class CollectionsRouter(BaseRouterV3):
                     f"User has reached the maximum number of collections allowed ({user_max_collections}).",
                     400,
                 )
+            logger.info(f"Creating collection {name}")
             collection = await self.services.management.create_collection(
                 owner_id=auth_user.id,
                 name=name,
@@ -603,6 +608,7 @@ class CollectionsRouter(BaseRouterV3):
             collection. Deleting a collection removes all associations but does
             not delete the documents within it.
             """
+            logger.info(f"Deleting collection {id}")
             if id == generate_default_user_collection_id(auth_user.id):
                 raise R2RException(
                     "Cannot delete the default user collection.",
@@ -611,7 +617,7 @@ class CollectionsRouter(BaseRouterV3):
             await authorize_collection_action(
                 auth_user, id, CollectionAction.DELETE, self.services
             )
-
+            logger.info(f"Deleting collection {id}")
             await self.services.management.delete_collection(collection_id=id)
             return GenericBooleanResponse(success=True)  # type: ignore
 

+ 8 - 3
py/core/main/api/v3/documents_router.py

@@ -295,19 +295,21 @@ class DocumentsRouter(BaseRouterV3):
             task_id.
             """
             if not auth_user.is_superuser:
-                user_document_count = (
+                user_document_count = 0
+                '''
+                (
                     await self.services.management.documents_overview(
                         user_ids=[auth_user.id],
                         offset=0,
                         limit=1,
                     )
                 )["total_entries"]
+                '''
                 user_max_documents = (
                     await self.services.management.get_user_max_documents(
                         auth_user.id
                     )
                 )
-
                 if user_document_count >= user_max_documents:
                     raise R2RException(
                         status_code=403,
@@ -336,13 +338,16 @@ class DocumentsRouter(BaseRouterV3):
                         message=f"User has reached the maximum number of chunks allowed ({user_max_chunks}).",
                     )
 
-                user_collections_count = (
+                user_collections_count = 0
+                '''
+                (
                     await self.services.management.collections_overview(
                         user_ids=[auth_user.id],
                         offset=0,
                         limit=1,
                     )
                 )["total_entries"]
+                '''
                 user_max_collections = (
                     await self.services.management.get_user_max_collections(
                         auth_user.id