diff --git a/optimade/server/entry_collections/entry_collections.py b/optimade/server/entry_collections/entry_collections.py index 5af264148..2a39a94be 100644 --- a/optimade/server/entry_collections/entry_collections.py +++ b/optimade/server/entry_collections/entry_collections.py @@ -149,7 +149,7 @@ def find( exclude_fields = self.all_fields - response_fields - results = [self.resource_mapper.map_back(doc) for doc in raw_results] + results: List = [self.resource_mapper.map_back(doc) for doc in raw_results] self.check_and_add_missing_fields(results, response_fields) if results: diff --git a/optimade/server/routers/utils.py b/optimade/server/routers/utils.py index 761b6f9a1..3cad26124 100644 --- a/optimade/server/routers/utils.py +++ b/optimade/server/routers/utils.py @@ -260,7 +260,7 @@ def get_entries( links = ToplevelLinks(next=None) if exclude_fields: - results = remove_exclude_fields(results, exclude_fields) + results = remove_exclude_fields(results, exclude_fields) # type: ignore[assignment] return response( links=links, @@ -312,7 +312,7 @@ def get_single_entry( links = ToplevelLinks(next=None) if exclude_fields and results is not None: - results = remove_exclude_fields(results, exclude_fields)[0] + results = remove_exclude_fields(results, exclude_fields)[0] # type: ignore[assignment] return response( links=links,