Commit graph

317 commits

Author SHA1 Message Date
justcool393
bfe8fb70f6
support infinite length posts and comments (fixes #229) 2023-02-25 04:18:30 -06:00
justcool393
ff09ba4209 SQLA migration: fix RemovedIn20Warnings 2023-02-24 05:54:56 -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
026a9efe2b user/submission/comment: avoid queries if awards are disabled 2023-02-08 17:54:12 -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
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
010c56a35e Implement #380: remove signatures feature. 2022-11-09 20:37:04 -06:00
Inire
4e2047624b Hide votes for posts and comments under 24 hours old 2022-10-27 21:50:08 -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
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
TLSM
965a4dc157 Fix improper calls to Comment.replies.
In four contexts, Comment.replies(.) was not updated to reflect the
interface changes with comment filtering. This directly caused #170
and #172 (which was a stack trace from the former).
  - Updating notifications for DMs (routes/users.py L690)
  - Updating notifications for modmail (routes/users.py L729)
  - morecomments for logged out users (routes/posts.py L421)
  - JSON for API access (classes/comment.py L347)

All four contexts seem to behave correctly after the change. However,
strictly speaking the JSON generation will not include a user's own
filtered or removed comments, though this is hard to remedy without
passing the user object `v` to json_core. Propagating that through the
codebase seems a worse option than leaving it as is.
2022-08-17 14:01:31 -05:00
Julian Rota
f736d660b6 Filter on other pages as well 2022-07-09 06:33:41 -05:00
Julian Rota
ba9689f017 Working on hiding filtered comments 2022-07-09 06:33:41 -05:00
Julian Rota
3c2871dd0f Set filter status badly so commenting works again 2022-07-09 06:33:41 -05:00
Julian Rota
d530cc6a7c Set up database changes for comment filtering 2022-07-09 06:33:41 -05:00
FatherInire
fcba426009
Remove some gimmicky r/drama features.
Co-authored-by: Inire <>
2022-05-21 21:43:00 -05:00
faul-sname
4892b58d10
Add migrations using alembic.
* #39 Add Flask-Migrate dep

* #39 Make it such that flask db init can run

https://github.com/miguelgrinberg/Flask-Migrate/issues/196#issuecomment-381343393

* Run flask db init, update migrations.env, commit artifacts

* Set up a script such that you can `docker-compose exec files bash -c 'cd /service; FLASK_APP="files/cli:app" flask '` and have it do whatever flask thing you want

* Fix circular dependency

* import * is evil

* Initial alembic migration, has issues with constraints and nullable columns

* Bring alts table up to date with alembic autogenerate

* Rerun flask db revision autogenerate

* Bring award_relationships table up to date with alembic autogenerate

* [#39/alembic] files/classes/__init__.py is evil but is at least explicitly evil now

* #39 fix model in files/classes/badges.py

* #39 fix model in files/classes/domains.py and files/classes/clients.py

* #39 fix models: comment saves, comment flags

* #39 fix models: comments

* Few more imports

* #39 columns that are not nullable should be flagged as not nullable

* #39 Add missing indexes to model defs

* [#39] add missing unique constraints to model defs

* [#39] Temporarily undo any model changes which cause the sqlalchemy model to be out of sync with the actual dump

* #39 Deforeignkeyify the correct column to make alembic happy

* #39 flask db revision --autogenerate now creates an empty migration

* #39 Migration format such that files are listed in creation order

* #39 Better first revision

* #39 Revert the model changes that were required to get to zero differences between db revision --autogenerate and the existing schema

* #39 The first real migration

* #39 Ensure that foreign key constraints are named in migration

* #39 Alembic migrations for FK constraints, column defs

* [#39] Run DB migrations before starting tests

* [#39] New test to ensure migrations are up to date

* [#39] More descriptive test failure message

* Add -T flag to docker-compose exec

* [#39] Run alembic migrations when starting the container
2022-05-17 18:55:17 -05:00
Michael House
19903cccb5
Adding usernotes. 2022-05-16 11:53:24 -05:00
iro84657
b7da8b575a Add trailing LF to text files 2022-05-10 21:05:51 -04:00
outruncolors
de062c025d
Added doubledown and insurance functionality (#235)
* Added doubledown functionality

* Add insurance
2022-05-01 20:24:01 +02:00
Aevann1
e5e27d4492 fds 2022-04-16 18:44:32 +02:00
Aevann1
0a963c00a8 fds 2022-04-16 18:42:28 +02:00
Aevann1
d5387f8e0e fsd 2022-04-16 18:42:18 +02:00
Aevann1
cc97944296 fds 2022-04-16 18:41:38 +02:00
Aevann1
42f70bc64e fdsfds 2022-04-15 18:28:08 +02:00
Aevann1
0f256238e1 gf 2022-04-10 20:42:58 +02:00
Aevann1
1f5799d82b sfd 2022-04-10 18:43:39 +02:00
Aevann1
3ca087239d fsd 2022-04-04 03:41:20 +02:00
Aevann1
6ef1f41bf6 pain 2022-04-04 01:44:54 +02:00
Aevann1
cfa74bf3d2 fds 2022-03-29 20:23:40 +02:00
Aevann1
de96579808 publish fix 2022-03-18 21:05:54 +02:00
Aevann1
e33c4ec93f fds' 2022-03-17 21:15:45 +02:00
Aevann1
eb288ec859 fg 2022-03-06 20:15:13 +02:00
Aevann1
70d35e6af4 chri 2022-03-06 06:23:12 +02:00
Aevann1
46077e7e94 wager 2022-03-06 05:55:02 +02:00
Aevann1
51ba200c7b dfs 2022-03-06 05:44:09 +02:00
Aevann1
86f0c5fdc5 fds 2022-03-06 05:40:23 +02:00
Aevann1
ea6be553ce made wordle and blackjack ajax 2022-03-06 05:25:23 +02:00
Aevann1
89e8c8a340 None 2022-03-05 01:49:38 +02:00
Aevann1
14c568dd3d coned 2022-03-04 23:23:33 +02:00
Aevann1
973f8e3c3b notif_utc 2022-03-04 19:33:58 +02:00
Aevann1
5faab645c2 transfers fix 2022-03-04 18:53:28 +02:00
Aevann1
b3f5559348 LumberFanatic I 2022-03-04 00:10:50 +02:00