Commit graph

803 commits

Author SHA1 Message Date
TLSM
3f360bb457 Remove special cases for unused awards.
Removes the following awards / fields on User:
 - flairlock
 - progressivestack
 - bird
 - longpost (pizzashill)
 - marseyawarded
 - rehab
 - deflector
 - mute
 - unmutable
 - eye (All-Seeing Eye)
 - alt (Alt-Seeing Eye)

Primarily motivated by starting to remove some un-Mottelike cruft
from core commenting/posting routes. Cleared out other inapplicable
awards while in the process.
2022-11-09 20:37:04 -06:00
TLSM
9e2ceb28b0 Fix four routes with auth_desired misimplemented.
PR #374 removed `@auth_required` from a number of routes and changed
those which used their `v` parameters to `v=None` and removed the `v`
parameter from those which didn't internally use it. 1841134b47

PR #392 re-added `@auth_desired` to those routes to ensure the
templates rendered with awareness of the current logged-in user
(matters for search, header bar, etc). 9f042c1aeb

However, 500 errors occurred on /random_post, /random_user, /id/<uid>,
and /u/<username>. Those were the four which had their `v` parameter
removed entirely. This has been re-added, which fixes the bug.

The way to understand auth_required vs auth_desired is that they are
nearly identical, with the sole difference than auth_required
checks if v is None and aborts with 401 if so. This means that
auth_desired routes must handle the v=None case. They are the same in
that they always try to give a `v` kwarg to the decorated function,
which was the root cause of those four routes erroring.

Recommended style: the vast majority of routes which return a rendered
template should be auth_desired, because the top-level templates often
draw extensively from `v` state even when the route handler does not.
When a route is either auth_desired or auth_required, it should have a
`v` parameter, which we typically give as the first positional
parameter.
2022-11-06 03:11:59 -06:00
electricwhisk
9f042c1aeb
Stay logged in on certain routes (#392)
This commit adds the @auth_desired decorator to
routes that previous had the @auth_required decorator,
but had it removed in #374. This should cause
the user to remain logged in on these routes.
2022-10-27 22:16:22 -05:00
FatherInire
b46ada9f72
Fix some deprecations and factor out a helper function (#387) 2022-10-27 22:15:48 -05:00
DinoInNameOnly
d354b0713d Allow search and other pages for logged out users 2022-10-14 06:26:08 -05:00
TLSM
716f078e81 Fix 'hot' sort intermediate value out-of-bounds.
Fixes #321. Due to the extremely large quantity of comments on a
typical Motte post, 'hot' sorting logic underflowed an intermediate
value. Roughly:

  |(-1 000 000) * (103 [votes] + 1 + 2723 [comments] / 1)| > 2^31

We resolve this by reducing the coefficient from 1e6 to 1e5, which
reduces precision of intermediate calculations somewhat, and by
dividing #comments by 10 rather than 1, which better matches Motte
user behavior regardless: Users comment much more often than vote.
This buys us two orders of magnitude more headroom before out-of-
bounds. Shouldn't be an issue until the CW thread reaches ~200k
comments.
2022-09-12 12:16:54 -05:00
TLSM
ccabc8b881 Change default RSS sort to 'new'. 2022-09-12 12:16:54 -05:00
TLSM
f5f2c008ad Fix approved filtered comments not notifying.
Moves behavior in api_comment that updates stateful counters and
generates notifications into a function which can also be called
if a filtered comment is approved. Fixes #272.

Incidentally, also fixes #278 by adding another filter to the post
subscribers query during general clean-up/refactoring.

Originally was going to move this function into the Comments model,
since assurances about state (even with side effects) should probably
be made there, but I couldn't find a sane way to untangle the imports.
2022-09-09 23:31:20 -05:00
TLSM
e407c29ec7 Fix #267: /comments respects shadowbans, filters.
Resolves root problem of non-admin users seeing comments they shouldn't
by JOINing on the appropriate fields and including them in the WHERE
clause of the query.

In the process, was also able to remove some unperformant queries
that used (potentially extremely long) lists passed to WHERE clauses in
lieu of proper JOINs.
2022-09-06 12:35:22 -05:00
TLSM
b31e1874dd Fix #230: present pinned posts first in all sorts. 2022-09-04 19:11:42 -05:00
Julian Rota
1e0aa4ee22 Merge branch 'frost' into new-user-filtering 2022-06-06 14:56:28 -04:00
Michael House
e7c7fba0ad Fixed 404 on random user button and changed icons 2022-06-05 17:02:34 -05:00
Michael House
f3f2aa3935 Made a lot of small changes in the frontend 2022-06-04 07:48:26 -05:00
Julian Rota
0002f66f36 Merge branch 'frost' into new-user-filtering 2022-05-22 17:01:45 -04:00
FatherInire
fcba426009
Remove some gimmicky r/drama features.
Co-authored-by: Inire <>
2022-05-21 21:43:00 -05:00
Julian Rota
f231726b3a Initial filtering of posts/submissions 2022-05-16 23:33:12 -04:00
iro84657
b7da8b575a Add trailing LF to text files 2022-05-10 21:05:51 -04:00
iro84657
35fdbd2e2e Remove references to holes 2022-05-09 11:01:11 -04:00
Ben Rog-Wilhelm
1ee9c1bfa7
Convert text file line endings to LF. 2022-05-09 07:20:47 -05:00
Michael House
67d5db425f Fixed a type in routes/front.py:180 2022-05-09 04:54:00 -05:00
iro84657
193ff08a3d Remove special cases based on request.host 2022-05-09 01:40:09 -04:00
iro84657
71743a3bfc Remove special cases based on SITE_NAME 2022-05-09 01:40:09 -04:00
iro84657
0bab69947a
Remove hot posts button from mobile interface (#38)
This commit also cleans up some remnants of the previous default sort
orders.
2022-05-08 23:21:43 -05:00
Aevann1
aba226b95b sfd\ 2022-05-02 20:07:17 +02:00
Aevann1
dbd973f6ca fsd 2022-05-02 03:45:22 +02:00
Aevann1
0a89fe1822 fsd 2022-05-02 03:41:08 +02:00
Aevann1
777971c378 sfd 2022-05-02 00:59:28 +02:00
Aevann1
7c661bb69b fsd 2022-05-02 00:59:08 +02:00
Aevann1
9e656a8e73 gfd 2022-05-02 00:56:19 +02:00
Aevann1
709a7fc4b5 sfd 2022-05-01 23:44:38 +02:00
Aevann1
1bf86d2288 fds 2022-05-01 02:54:17 +02:00
Aevann1
240b451962 fsd 2022-05-01 02:53:24 +02:00
Aevann1
5d8434b95f fds 2022-04-29 17:22:31 +02:00
Aevann1
70a31aa9cb sfd 2022-04-29 17:17:14 +02:00
Aevann1
9895ca2110 fsd 2022-04-29 16:02:52 +02:00
Aevann1
4536f4e1d4 fsd 2022-04-29 02:02:00 +02:00
Aevann1
99755ce4c6 sfd 2022-04-28 03:02:37 +02:00
Aevann1
69a6afd9c5 fds 2022-04-26 02:26:27 +02:00
Aevann1
58a6a86e74 fsd 2022-04-26 00:48:28 +02:00
Aevann1
72cb84d1cd Revert "vxc"
This reverts commit c21f04d664.
2022-04-25 23:59:12 +02:00
Aevann1
7813db66ab dfs 2022-04-25 21:52:30 +02:00
Aevann1
c21f04d664 vxc 2022-04-25 18:38:06 +02:00
Aevann1
91540c161a Revert "RESTORE CACHE"
This reverts commit fe25f41fad.
2022-04-19 22:22:24 +02:00
Aevann1
fe25f41fad RESTORE CACHE 2022-04-19 22:21:47 +02:00
Aevann1
37c64f9fb8 fds 2022-04-18 00:16:02 +02:00
Aevann1
186cf3a528 fds 2022-04-18 00:13:37 +02:00
Aevann1
42db0240f2 dfs 2022-04-17 19:16:15 +02:00
Aevann1
267b498f4d fds 2022-04-17 19:04:11 +02:00
Aevann1
bfae9f368b fsd 2022-04-17 11:23:42 +02:00
Aevann1
c3c5dda987 fds 2022-04-16 19:01:46 +02:00