aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/search.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2022-01-05 09:03:44 -0800
committerBryan Newbold <bnewbold@archive.org>2022-01-05 09:03:44 -0800
commit1eb4149c0619fcaf806a5c95017f438acee9143f (patch)
tree3537a01bc85b7519c8cf67a8face8d5da0ac4dc5 /fatcat_scholar/search.py
parent238b271dfebd94371ee85ffa862bbe429ad21633 (diff)
downloadfatcat-scholar-1eb4149c0619fcaf806a5c95017f438acee9143f.tar.gz
fatcat-scholar-1eb4149c0619fcaf806a5c95017f438acee9143f.zip
move public domain wall to 1926 ('before 1927')
Diffstat (limited to 'fatcat_scholar/search.py')
-rw-r--r--fatcat_scholar/search.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/fatcat_scholar/search.py b/fatcat_scholar/search.py
index c49bd98..b99a661 100644
--- a/fatcat_scholar/search.py
+++ b/fatcat_scholar/search.py
@@ -50,7 +50,7 @@ class FulltextQuery(BaseModel):
{"label": gettext("Past Week"), "slug": "past_week"},
{"label": gettext("Past Year"), "slug": "past_year"},
{"label": gettext("Since 2000"), "slug": "since_2000"},
- {"label": gettext("Before 1925"), "slug": "before_1925"},
+ {"label": gettext("Before 1927"), "slug": "before_1927"},
],
}
type_options: Any = {
@@ -198,8 +198,9 @@ def apply_filters(search: Search, query: FulltextQuery) -> Search:
elif query.filter_time == "since_2000":
this_year = datetime.date.today().year
search = search.filter("range", year=dict(gte=2000, lte=this_year))
- elif query.filter_time == "before_1925":
- search = search.filter("range", year=dict(lt=1925))
+ elif query.filter_time == "before_1925" or query.filter_time == "before_1927":
+ # 1925 value retained for backwards compatibility in URLs
+ search = search.filter("range", year=dict(lte=1927))
elif query.filter_time == "all_time" or query.filter_time is None:
pass
else: