Commit graph

1060 commits

Author SHA1 Message Date
justcool393
d0ba568738 classes: use self.__class__.__name__ in __repr__ 2023-02-25 04:21:33 -06:00
justcool393
bfe8fb70f6
support infinite length posts and comments (fixes #229) 2023-02-25 04:18:30 -06:00
justcool393
44919507e9
leaderboard refactor (#526) 2023-02-24 06:31:17 -06:00
justcool393
ff09ba4209 SQLA migration: fix RemovedIn20Warnings 2023-02-24 05:54:56 -06:00
justcool393
872d9c613b
videos: remove video uploads lol 2023-02-17 21:26:40 -06:00
justcool393
9f7e7ef980 oauth: fix length constraints 2023-02-17 14:42:37 -06:00
justcool393
a8013f1089 fix api comments (fixes #512) 2023-02-17 14:42:06 -06:00
Snakes
84e5c7c651
Merge branch 'frost' into feature-award-feature-flag 2023-02-11 23:41:41 -05:00
justcool393
5d6641c890 remove Comment.print() and Submission.print() functions
these functions i don't believe exist upstream and i guess were to
diagnose an issue with author_ids not being saved properly. anyway not
really useful now as if an author_id doesn't exist, some major db
corruption has prolly already happened.
2023-02-10 14:01:28 -06:00
justcool393
1817008a91
remove profile songs (ref #470) (#499)
* removes profile songs (ref #470)

* Remove ffmpeg, remaining song subsystem

  - Remove references to User.song in userpage* templates
  - Generate migration to drop column
  - Remove ffmpeg dependency in Docker

* remove python 2 era __future__ import

---------

Co-authored-by: TLSM <duolsm@outlook.com>
2023-02-10 13:56:04 -06:00
justcool393
f8f55be8b0
constantify render depth limit 2023-02-10 13:54:49 -06:00
justcool393
f4445fd58e award feature: use feature flag in more places 2023-02-09 10:12:49 -06:00
justcool393
026a9efe2b user/submission/comment: avoid queries if awards are disabled 2023-02-08 17:54:12 -06:00
justcool393
86ea70dfd3 awards: remove all award definitions 2023-02-07 07:03:36 -06:00
justcool393
4a280e345a style: remove unnecessary str call (the thing is already a str!) 2023-02-07 07:00:41 -06:00
faul_sname
8d24fc3a48 [themotte/rDrama#451] Add relation 2023-01-03 01:44:40 -08:00
faul_sname
9525396131 [themotte/rDrama#451] DDL: add comments.descendant_count column 2023-01-02 23:58:25 -08:00
faul_sname
4010a0e752 [themotte/rDrama#451] Remove the import *
Fixes a bug if someone is serving localhost on a port that is not port 80
2022-12-30 20:25:57 -08:00
Ben Rog-Wilhelm
b4efd75753 Merge branch 'frost' into pr-eager-content 2022-12-17 17:17:32 -06:00
justcool393
1ae3dc85c2
Fix: Redirect loop on formkey or nonce mismatch.
* fix 401-302-401-302-429 loop

* don't logout users on bad form key, just treat the request as unauthenticated

* Handle None/empty case in validate_formkey.

A supplied empty formkey, or the lack of a supplied formkey (None) is not a valid formkey. Handle this inside the function rather than at the call-site.

* Validate as false if no hashstr or string

Co-authored-by: Snakes <104547575+TLSM@users.noreply.github.com>
2022-12-17 11:20:27 -06:00
justcool393
a213396854
Solve blocking weaponization.
* allow anyone to reply to their blockers

* revert userblocks thing

* get rid of unnecessary template

* make blocking page accurate

* comment author things

* fix prev commit

* fix block page

* comma splice

Co-authored-by: Snakes <104547575+TLSM@users.noreply.github.com>
2022-12-17 11:11:51 -06:00
Ben Rog-Wilhelm
0f91324603 Volunteer Janitor: Response recording. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
0a8bbae290 Volunteer Janitor: Record accepted tasks. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
03b323c7a1 Volunteer Janitor: Initial duty acquisition. 2022-12-01 18:53:24 -08:00
TLSM
afe209d5d8
Eager load comments for post rendering.
GET /post/1/clever-unique-post-title-number-0
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |  942   |   0    |   1    |   0    |  943   |    921     |
|----------|--------|--------|--------|--------|--------|------------|
Total queries: 943 in 0.377s # request time in browser 17249ms

GET /post/1/clever-unique-post-title-number-0
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |   58   |   0    |   1    |   0    |   59   |     35     |
|----------|--------|--------|--------|--------|--------|------------|
Total queries: 59 in 0.0423s # request time in browser 544ms

Also, fixes seed_db not populating top_comment_id on generated
comments. If you want to test locally with seed_db test data, you need
to reseed.
2022-11-28 17:47:54 -05:00
TLSM
5aaef144cf
Deduplicate post/comment sorting & time filtering.
Ported in from upstream with adjustments for TheMotte, most notably
universal default to 'new' and fixes to 'hot'. Lumped into this PR
because eager comment loading uses it.
2022-11-28 14:33:24 -05:00
TLSM
4d22d9bce2
Eager load get_posts for submission_listings.
Ported in logic from upstream to use SQLAlchemy eager loading instead
of repeated queries when building a submission_listing. Adjusted
loaded relationships to include only those used on TheMotte.

Using test data from seed_db, before and after:

GET /
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |   83   |   0    |   0    |   0    |   83   |     72     |
|----------|--------|--------|--------|--------|--------|------------|
Total queries: 83 in 0.031s

GET /
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |   14   |   0    |   0    |   0    |   14   |     0      |
|----------|--------|--------|--------|--------|--------|------------|
Total queries: 14 in 0.00718s
2022-11-28 12:55:31 -05:00
justcool393
23e64d176d
discord: remove 2022-11-21 12:39:27 -06:00
Ben Rog-Wilhelm
127aed8dd0 Fix: Usernotes no longer actually work. 2022-11-11 16:17:37 -06:00
Ben Rog-Wilhelm
583f4131dc Fix: Mod usernotes leaked to the public. 2022-11-11 15:08:01 -06:00
Ben Rog-Wilhelm
7c72815dcc
Merge branch 'frost' into remove-more-dramaisms 2022-11-09 20:45:31 -06:00
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
9de6f20dea Remove vestigial user ID special cases. 2022-11-09 20:37:04 -06:00
TLSM
010c56a35e Implement #380: remove signatures feature. 2022-11-09 20:37:04 -06:00
justcool393
2fabe6d010 remove "meme admin" functionality
(JL1, which doesn't actually have any real use on the site, and their "meme" status is hidden to non-admins anyway)
2022-11-07 03:33:56 -06:00
justcool393
51ef10d7c3 remove vestiges of fart mode 2022-11-07 03:30:31 -06:00
Inire
4e2047624b Hide votes for posts and comments under 24 hours old 2022-10-27 21:50:08 -05:00
Jack Byrne
1b9f7860c5 nicer and more efficient sanitisation 2022-09-11 06:12:26 -05:00
Jack Byrne
8c7c76feb6 Remove (admittedly funny) rDrama 'troll titles' 2022-09-11 06:12:26 -05:00
Ben Rog-Wilhelm
20fa9ce79f Move a bunch of moderation tools to admin level 2 2022-09-06 18:51:24 -05:00
TLSM
f5c3d944e8 Fix short child comments auto-collapsing.
Bug accidentally introduced with 70c8a942b6, when a removed clause
in Comment.collapse_for_user was treated as always True, rather than
as always False--which would've removed this entire line, as this
commit does now.

Original intent of the logic was for auto-collapsing game comments
like blackjack and slots that necessarily entailed somewhat spammy
commenting behavior.
2022-09-06 17:51:58 -05:00
TLSM
eea23f1e7c Fix #260: sort replies to comments by new. 2022-09-05 23:44:18 -05:00
TLSM
70c8a942b6 Remove games.
Unfortunately not totally dead code paths, and special case behavior
for them complicated commenting and sorting logic in a number of
places.
2022-09-05 23:44:18 -05:00
TLSM
3e8904757a Remove coins from popovers, disable coin routes.
The last places coins were visible to non-admins were in user popovers
and, potentially, via direct access of /@<username>/coins. These have
been removed.

Additionally, there are a number of routes which, despite being removed
from the UI, were still operative and usable. These are disabled
pending possible(?) future uses of coins.
2022-09-05 23:44:18 -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
TLSM
e12b0eea1a Remove treasure rewards for comments.
Given that coins are not visible in many contexts, the conspicuous
appearance of treasure chests (random coin rewards on 1% of comments)
seems out of place. This removes the logic which rewards treasure,
the visible display of treasure, and drops the column containing
treasure information which has already been awarded to at least one
comment on prod.
2022-09-04 19:12:30 -05:00
JulianRota
9657adbebf
Merge pull request #227 from TLSM/rework-assets
Rework assets to use automatic cachebusting (#127).
2022-09-01 00:28:39 -04:00
TLSM
a35697e55e
Replace nearly all ?v= cachebusts with assetcache.
Using the new assetcache module, we replace (almost) all instances
of `?v=` cachebusting query parameters in Python and in Jinja templates.
The primary exceptions were: user site backgrounds, and some
infrequently changed graphics referenced literally from .js files.
2022-08-30 17:02:46 -04:00
TLSM
b2773cbb40
Clarify permabanned forbidden messages.
Fixes #221. Provides custom message behavior for the user DM route
and slightly refactors the `@is_not_permabanned` wrapper to not be
deliberately misleading to users.
2022-08-30 13:35:02 -04:00
Ben Rog-Wilhelm
de4d923b32 Fix some mod log errors and make it more durable to future changes. 2022-08-27 11:23:12 -05:00