File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,19 @@ def get_clowder_v1_user_collections(headers, user_v1):
153153# TODO this is too slow, we need to optimize it
154154def get_clowder_v1_dataset_collections (headers , user_v1 , dataset_id ):
155155 matching_collections = []
156- endpoint = f"{ CLOWDER_V1 } /api/collections/allCollections"
157- response = requests .get (endpoint , headers = headers )
156+ endpoint1 = f"{ CLOWDER_V1 } /api/collections/rootCollections?superAdmin=true"
157+ endpint2 = f"{ CLOWDER_V1 } /api/collections/topLevelCollections?superAdmin=true"
158+ response = requests .get (endpoint1 , headers = headers )
159+ response2 = requests .get (endpint2 , headers = headers )
158160 user_collections = response .json ()
161+ user_collections_ids = []
162+ user_collections_ids_2 = []
163+ user_collections_2 = response2 .json ()
164+ for collection in user_collections_2 :
165+ id = collection ['id' ]
166+ user_collections_ids_2 .append (id )
167+ for collection in user_collections :
168+ user_collections_ids .append (collection ['id' ])
159169 for collection in user_collections :
160170 collection_id = collection ["id" ]
161171 collection_dataset_endpoint = (
You can’t perform that action at this time.
0 commit comments