Commit 9985bb66 authored by Deimos's avatar Deimos

Change default time period to "all time"

Previously, the default time period for topic listings under the
Activity sort (which is the overall default) was set to 3 days. Part of
the purpose of this was to stop long-lived, off-topic threads from
sitting at the top of the site indefinitely. However, now that the
Activity sort is adjusted to have a way to consider these threads
"uninteresting" and prevent them from bumping, that's no longer

We can try Activity/"all time" as the default sorting again, and should
be able to resolve any issues through using the "uninteresting"
judgments instead of trying to use the shorter time period to hide it.
parent 5786b130
......@@ -349,10 +349,7 @@ def post_comment_on_topic(request: Request, markdown: str) -> HTTPFound:
def _get_default_settings(request: Request, order: Any) -> DefaultSettings: # noqa
if isinstance(request.context, Group):
is_home_page = False
if request.user:
if isinstance(request.context, Group) and request.user:
user_settings = (
......@@ -363,9 +360,6 @@ def _get_default_settings(request: Request, order: Any) -> DefaultSettings: # n
user_settings = None
is_home_page = True
user_settings = None
if user_settings and user_settings.default_order:
default_order = user_settings.default_order
......@@ -388,17 +382,11 @@ def _get_default_settings(request: Request, order: Any) -> DefaultSettings: # n
# Overall default periods, if the user doesn't have either a group-specific or a
# home default set up:
# * "all time" if sorting by new
# * "all time" if sorting by activity and inside a group
# * "3 days" if sorting by activity and on home page
# * "1 day" otherwise (sorting by most votes or most comments)
if order == TopicSortOption.NEW:
default_period = None
elif order == TopicSortOption.ACTIVITY and not is_home_page:
default_period = None
elif order == TopicSortOption.ACTIVITY:
default_period = SimpleHoursPeriod(72)
# * "1 day" if sorting by most votes or most comments
# * "all time" otherwise
if order in (TopicSortOption.VOTES, TopicSortOption.COMMENTS):
default_period = SimpleHoursPeriod(24)
default_period = None
return DefaultSettings(order=default_order, period=default_period)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment