Sorting: add comments sort for comments and constantify sorts

This commit is contained in:
justcool393 2023-02-16 17:52:43 -06:00
parent 0af172d173
commit 5f73302b28
12 changed files with 79 additions and 247 deletions

View file

@ -215,14 +215,14 @@ def settings_profile_post(v):
defaultsortingcomments = request.values.get("defaultsortingcomments")
if defaultsortingcomments:
if defaultsortingcomments in {"new", "old", "controversial", "top", "bottom"}:
if defaultsortingcomments in SORTS_ALL:
v.defaultsortingcomments = defaultsortingcomments
updated = True
else: abort(400)
defaultsorting = request.values.get("defaultsorting")
if defaultsorting:
if defaultsorting in {"hot", "bump", "new", "old", "comments", "controversial", "top", "bottom"}:
if defaultsorting in SORTS_POSTS:
v.defaultsorting = defaultsorting
updated = True
else: abort(400)