Skip to content

Commit cdd580b

Browse files
committed
clean up
1 parent 827c68a commit cdd580b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/core.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ def all_collections(self, **kwargs) -> Collections:
7272
def get_collection(self, collection_id: str, **kwargs) -> Collection:
7373
"""Get collection by id."""
7474
base_url = str(kwargs["request"].base_url)
75-
collection = self.database.find_collection(collection_id=collection_id)[
76-
"_source"
77-
]
75+
collection = self.database.find_collection(collection_id=collection_id)
7876
return self.collection_serializer.db_to_stac(collection, base_url)
7977

8078
@overrides

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def find_collection(self, collection_id: str) -> Collection:
283283
except elasticsearch.exceptions.NotFoundError:
284284
raise NotFoundError(f"Collection {collection_id} not found")
285285

286-
return collection
286+
return collection["_source"]
287287

288288
def delete_collection(self, collection_id: str):
289289
"""Database logic for deleting one collection."""

0 commit comments

Comments
 (0)