Skip to content

Commit

Permalink
Give default lanes lower priority
Browse files Browse the repository at this point in the history
So that custom lanes from Kimppas will show up on top.
  • Loading branch information
attemoi committed Apr 25, 2024
1 parent 6aea2ae commit 88860aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api/lanes.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def create_default_lanes(_db, library):
if not large and not small and not tiny:
estimates = library.estimated_holdings_by_language()
large, small, tiny = _lane_configuration_from_collection_sizes(estimates)
priority = 0

priority = 1000

if large and len(large) > 0:
language = large[0]
Expand Down
4 changes: 2 additions & 2 deletions tests/api/test_lanes.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ def test_create_default_lanes(
} == {x.display_name for x in lanes}

[english_fiction_lane] = [x for x in lanes if x.display_name == "Fiction"]
assert 0 == english_fiction_lane.priority
assert 1000 == english_fiction_lane.priority
[world] = [x for x in lanes if x.display_name == "World Languages"]
assert 5 == world.priority
assert 1005 == world.priority

# ensure the target age is appropriately set for the children and middle grade lane
[children_and_middle_grade_lane] = [
Expand Down

0 comments on commit 88860aa

Please sign in to comment.