diff --git a/api/admin/controller/custom_lists.py b/api/admin/controller/custom_lists.py index c2fc8d4f7..9a0bc3ed3 100644 --- a/api/admin/controller/custom_lists.py +++ b/api/admin/controller/custom_lists.py @@ -290,7 +290,7 @@ def _create_or_update_list( # If this list was used to populate any lanes, those lanes need to have their counts updated. for lane in Lane.affected_by_customlist(list): - lane.update_size(self._db, self.search_engine) + lane.update_size(self._db, search_engine=self.search_engine) new_collections = [] for collection_id in collections: @@ -399,7 +399,7 @@ def custom_list(self, list_id: int) -> Response | dict | ProblemDetail | None: # Update the size for any lanes affected by this # CustomList which _weren't_ deleted. for lane in surviving_lanes: - lane.update_size(self._db, self.search_engine) + lane.update_size(self._db, search_engine=self.search_engine) return Response(str(_("Deleted")), 200) return None diff --git a/api/admin/controller/lanes.py b/api/admin/controller/lanes.py index ac80b125b..7e5e6bcb0 100644 --- a/api/admin/controller/lanes.py +++ b/api/admin/controller/lanes.py @@ -160,7 +160,7 @@ def lanes_for_parent(parent): for list in lane.customlists: if list.id not in custom_list_ids: lane.customlists.remove(list) - lane.update_size(self._db, self.search_engine) + lane.update_size(self._db, search_engine=self.search_engine) if is_new: return Response(str(lane.id), 201) diff --git a/core/lane.py b/core/lane.py index 0e7a42cd3..6af0a00d4 100644 --- a/core/lane.py +++ b/core/lane.py @@ -2953,10 +2953,7 @@ def uses_customlists(self): return True return False - @inject - def update_size( - self, _db, search_engine: ExternalSearchIndex = Provide["search.index"] - ): + def update_size(self, _db, search_engine: ExternalSearchIndex): """Update the stored estimate of the number of Works in this Lane.""" library = self.get_library(_db)