Commit graph

124 commits

Author SHA1 Message Date
TLSM
9de6f20dea Remove vestigial user ID special cases. 2022-11-09 20:37:04 -06:00
TLSM
c85cd469a1 Move post/comment ID boilerplate inside getters.
Borrows code from the upstream which has been working in production
reliably for ~months. Also, most of it was literally copy-pasted,
and the casted ID values aren't used later in the route functions.
2022-11-09 20:37:04 -06:00
TLSM
7a6f95a3b1 Fix #241: admin action rate limits too low.
Explicitly exempts admin action routes from rate limiting because
the limits were being hit during normal user behavior.

While verbose, alternatives like grouping admin routes into e.g. a
Flask blueprint to modify their behavior as a collective would have
been a larger refactor than seemed wise at the moment.

Also, some routes that were limited at 1/second were originally set
as such as a makeshift debounce for people double-clicking buttons.
This was discussed and deemed an acceptable risk compared to making
the mod queue more frustrating to go through.
2022-09-06 12:35:22 -05:00
TLSM
dbaf0a1bfd Remove unused polls code to reduce query volume.
Due to use of Submission.{choices, options, bet_options} in realbody,
generating submission_listings resulted in extremely high volume of
SELECT queries.

In local testing with 6 posts, one of which had a poll with 2 options,
the removal of these calls reduced quantity of queries on the homepage
from 84 to 22.

Given that it was previously decided to remove the polls feature after
a regression while adding comment filtering, the remaining dead code
paths for polls were also removed.
2022-09-05 23:44:18 -05:00
JulianRota
cc85b28288
Merge pull request #123 from zorbathut/pr_linearvote
Make downvotes actually reduce user karma.
2022-07-29 10:17:18 -04:00
Ben Rog-Wilhelm
2595ed7fc0 Remove dead references to DEFAULT_IMAGE. 2022-07-26 03:35:55 -05:00
Ben Rog-Wilhelm
42412ed40b Redesign the comment/post voting code and properly support standard votes. 2022-07-24 04:37:44 -05:00
Ben Rog-Wilhelm
17d550f00e Make downvotes actually reduce user karma. 2022-07-23 05:52:54 -05:00
Ben Rog-Wilhelm
19e9c1a20e Hide vote details from non-admins.
It is intentional that the links show up on admin level 2 but aren't usable until admin level 3; I don't know what I want right now and I want to encourage admins to pester me about it.
2022-07-23 03:04:43 -05:00
Michael House
ddb1523bde Fixed a merge conflict that I somehow missed and removed marsey images from seed db 2022-05-22 08:27:13 -05:00
Michael House
82a18e5cad Up-merged and resolved conflicts in routes/login.p and routes/votes.py 2022-05-22 08:23:59 -05:00
FatherInire
fcba426009
Remove some gimmicky r/drama features.
Co-authored-by: Inire <>
2022-05-21 21:43:00 -05:00
Michael House
f3a479f991 Removed emoji feature from templates and deleted emoji images 2022-05-18 20:53:28 -05:00
iro84657
b7da8b575a Add trailing LF to text files 2022-05-10 21:05:51 -04:00
Ben Rog-Wilhelm
1ee9c1bfa7
Convert text file line endings to LF. 2022-05-09 07:20:47 -05:00
TLSM
344df24148
Fix comment self-upvote removal UI bug. (#236)
Fixes minor UI bug when removing self-upvote on a comment. Previous
behavior, starting from a new comment:
    - Initial state: score 1 from self-upvote, upvote button shows
      highlighted as `color: var(--primary)`.
    - Click on upvote button to remove self-upvote → button
      unhighlights, score displays as 0.
    - [reload page]
    - Score displays as 0, but button is highlighted.
    - Click on upvote button → button unhighlights, score displays
      as -1. [If you reload the page now, state is score 0 &
      highlighted; no change in serverside votes.]
    - Click on upvote again → button highlights, score displays as 0.
    - [reload page]
    - Score displays as 1, button is highlighted.
Direct cause is `templates/comments.html @ L115-117`. I checked
`api_comment`, though, and it adds a vote on new comments, and that
state change propagates to the template's parameters before it renders,
so I believe the only time this triggers is specifically when a user
has removed their self-upvote. Bug is fixed when testing with L115-117
removed. Is there some other edge case it was meant to solve?

Secondary bugfix: Removing a self-upvote _costs_ you a coin & a
truescore point. I think this is one of the few ways to get negative
dramacoin. I chose to fix it by having self-votes and self-unvotes not
change coins/truecoins. The alternative of having new comments & posts
give the user +1 coin/truecoin would modify site behavior, and you'd
retroactively owe some powerusers thousands of DC & truescore.
2022-05-02 20:12:28 +02:00
Aevann1
0a14f96fbf fsd 2022-04-20 21:25:19 +02:00
Aevann1
c50cb5ca30 fsd 2022-03-31 16:25:49 +02:00
Aevann1
8f877e6aff fg 2022-03-29 21:34:35 +02:00
Aevann1
5c9d531900 fds 2022-03-21 02:40:15 +02:00
Aevann1
e883b0f76a g.db.commit() 2022-03-19 14:52:36 +02:00
Aevann1
200c2461b8 right 2022-03-09 03:44:53 +02:00
Aevann1
fde6526a56 fds' 2022-02-23 07:17:03 +02:00
Aevann1
f90db38c08 gf 2022-02-16 03:42:11 +02:00
Aevann1
dd39711709 g 2022-02-16 03:16:01 +02:00
Aevann1
7d223d9b87 fds 2022-02-07 14:46:28 +02:00
Aevann1
2464775210 cxv 2022-02-07 14:38:45 +02:00
Aevann1
8ef929002d xv 2022-02-07 13:39:26 +02:00
Aevann1
b3a9da6103 fds\ 2022-02-05 13:31:05 +02:00
Aevann1
53b1a2f862 sd 2022-02-04 10:59:12 +02:00
Aevann1
c2beea12ef vxc 2022-02-03 08:39:02 +02:00
Aevann1
b4dc4e1679 cxzxzc 2022-01-22 12:14:15 +02:00
Aevann1
ccd66d721a cxvxcv 2022-01-21 22:56:56 +02:00
Aevann1
694dfca0a4 fds 2022-01-19 11:07:16 +02:00
Aevann1
dc85175931 vcxcxv 2022-01-17 23:36:04 +02:00
Aevann1
1d83c1f63f fff 2022-01-17 15:15:01 +02:00
Aevann1
b85cf076f1 f 2022-01-17 15:09:11 +02:00
Aevann1
933831c422 testing 2022-01-15 08:31:17 +02:00
Aevann1
24245d95cc b 2022-01-14 14:04:34 +02:00
Aevann1
fbe6c3dd26 g 2022-01-14 01:29:15 +02:00
Aevann1
609bbfafc6 closing2 2022-01-11 23:54:41 +02:00
Aevann1
1bea9edf79 under attack 2022-01-09 17:15:02 +02:00
Aevann1
6b7e06f461 big one 2022-01-06 18:46:09 +02:00
Aevann1
d456aaa0c7 fsd 2022-01-02 02:06:46 +02:00
Aevann1
a0c4a66d59 big update 2022-01-01 01:45:27 +02:00
Aevann1
b18fa7be39 fsd 2021-12-27 03:08:06 +02:00
Aevann1
1a43b0dedc pins logic rework 2021-12-26 03:03:21 +02:00
Aevann1
bdf46e024e fds 2021-12-24 05:59:07 +02:00
Aevann1
6f28956493 fdsfsd 2021-12-23 17:37:12 +02:00
Aevann1
ea91371c04 fdssfd 2021-12-20 22:03:59 +02:00