Commit graph

15662 commits

Author SHA1 Message Date
faul_sname
2e29b468ec [themotte/rDrama#451] Add a test for comment.descendant_count accuracy 2023-01-03 01:45:37 -08:00
faul_sname
8d24fc3a48 [themotte/rDrama#451] Add relation 2023-01-03 01:44:40 -08:00
faul_sname
9c1e247685 [themotte/rDrama#451] Fixture fixes 2023-01-03 01:36:40 -08:00
faul_sname
7d12ddc89e [themotte/rDrama#451] With tests in place, extract out logic for updating the counters 2023-01-03 01:24:20 -08:00
faul_sname
7bfccf36d0 [themotte/rDrama#451] And finally that test can test the comment count correctly 2023-01-03 01:18:15 -08:00
faul_sname
19e9b161d4 [themotte/rDrama#451] When a comment is removed, aggregates (post comment count, author comment count) are updated 2023-01-03 01:17:41 -08:00
faul_sname
f8c27f3620 [themotte/rDrama#451] define comment_on_unpublish() function 2023-01-03 01:17:00 -08:00
faul_sname
2e0104a7cc [themotte/rDrama#451] Expand test coverage to cover who should see removed comments 2023-01-03 01:12:31 -08:00
faul_sname
28f4807a9b [themotte/rDrama#451] Move comment_on_publish() to files/helpers/comments.py 2023-01-03 01:11:50 -08:00
faul_sname
9525396131 [themotte/rDrama#451] DDL: add comments.descendant_count column 2023-01-02 23:58:25 -08:00
faul_sname
d7589716f6 [themotte/rDrama#451] Fix test 2023-01-01 23:06:51 -08:00
faul_sname
e7508dad56 [themotte/rDrama#451] A test 2022-12-31 02:35:37 -08:00
faul_sname
b06a481a0f [themotte/rDrama#451] Ability to disable secure session cookie with env var 2022-12-31 02:18:56 -08:00
faul_sname
8b7e637e6e [themotte/rDrama#451] The basic post/comment test should not fail no matter what env says 2022-12-31 02:07:18 -08:00
faul_sname
6905710b18 [themotte/rDrama#451] Sometimes we also want the user, not just their session 2022-12-31 02:06:42 -08:00
faul_sname
f78345a4fb [themotte/rDrama#451] Decorator when we do not want to rate limit in tests 2022-12-31 02:06:17 -08:00
faul_sname
0dcca12c04 [themotte/rDrama#451] New fixture for comments 2022-12-31 02:05:22 -08:00
faul_sname
4bfb66272c [themotte/rDrama#451] New fixture for submissions 2022-12-31 02:05:02 -08:00
faul_sname
9468e217f0 [themotte/rDrama#451] Allow explicitly setting the scheme to http or https in env 2022-12-30 23:39:46 -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
f4c6c7cf91 Fix: Deleted comments show up in the Janitor Volunter system. 2022-12-30 01:44:16 -06:00
Ben Rog-Wilhelm
fe800dd9a5 Add a grandchild comment test. 2022-12-28 09:14:33 -06:00
Ben Rog-Wilhelm
fb77cbcc2b Fix: Post view count does not update properly. 2022-12-22 20:09:57 -06:00
Ben Rog-Wilhelm
0454a64020 Fix: Janitor rule page incorrectly links to localhost. 2022-12-18 12:53:01 -08:00
Ben Rog-Wilhelm
90d4bd2b3c
Enable Janitor feature by default. (#448)
Co-authored-by: Ben Rog-Wilhelm <zorba@pavlovian.net>
2022-12-18 09:29:21 -06:00
Ben Rog-Wilhelm
e257db1542
Refactor test system to be more extendable, add comment test 2022-12-17 19:41:35 -06:00
Ben Rog-Wilhelm
23a8fb9663
Merge pull request #439 from TLSM/pr-eager-content
Eager loading comments for posts, submission_listings, supporting changes.
2022-12-17 15:29:44 -08:00
Ben Rog-Wilhelm
b4efd75753 Merge branch 'frost' into pr-eager-content 2022-12-17 17:17:32 -06:00
Ben Rog-Wilhelm
4a26beaebd Downgrade to Python 3.10 to solve some stability issues. 2022-12-17 11:09:00 -08:00
Ben Rog-Wilhelm
411859d99f Fix Github badges. 2022-12-17 09:28:16 -08:00
justcool393
3f2e8629df ratelimiting: check after required request g attributes are set 2022-12-17 09:21:40 -08: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
af31abd545 Fix: Volunteer config not parsed properly. 2022-12-05 00:49:34 -08:00
Ben Rog-Wilhelm
b7a8297669 Improve error output for util function. 2022-12-05 00:49:19 -08:00
justcool393
0c632d73b7
Rework error system a bit to remove a bunch of duplicated code (#434) 2022-12-01 20:58:27 -06:00
Ben Rog-Wilhelm
08602b4279 Volunteer Janitor: Minor cleanups. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
8fd9177711 Volunteer Janitor: Minor phrasing tweak. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
5fef5ca908 Volunteer Janitor: Add global enable/disable. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
0f74f6a4e2 Volunteer Janitor: Warn on page exit. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
f02ab5d27b Volunteer Janitor: Visual design for Work page. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
e75634f40a Volunteer Janitor: Visual design for Submit page. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
78cced0c37 Volunteer Janitor: Visual design for Teaser page. 2022-12-01 18:53:24 -08:00
Ben Rog-Wilhelm
b80fe29545 Volunteer Janitor: Initial checkin of images. 2022-12-01 18:53:24 -08: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
Ben Rog-Wilhelm
e43db0535d Volunteer Janitor: Initial hooks. 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