Commit Graph

3525 Commits

Author SHA1 Message Date
Tarrgon
1425332c0b [Replacements] Allow janitor+ to auto approve submitted replacements (#650) 2024-07-28 18:12:41 -07:00
Sindrake
d0748f00bb [ForumPosts] Fix a permission bug 2024-07-22 14:22:09 -07:00
Sindrake
cc1189292c [UserFeedbacks] Fix a misnamed mod action 2024-07-21 15:20:40 -07:00
Donovan Daniels
4a0a0c2f93
[UserFeedbacks] Add ability to soft delete feedbacks (#670) 2024-07-21 10:58:40 -07:00
Donovan Daniels
0346f86ac7
[Artists] Convert is_active into proper deletion (#660) 2024-07-20 11:45:36 -07:00
Donovan Daniels
b28bb5c99f
[ForumTopics] Fix page number mismatch (#675)
Fixes an issue introduced in #674.
2024-07-20 09:23:26 -07:00
Donovan Daniels
af0036db6b
[Forums] Clean up permission checks (#674) 2024-07-14 13:14:09 -07:00
Donovan Daniels
d9f6653e02
[Posts] Overhaul destroyed posts (#672) 2024-07-13 17:05:50 -07:00
Donovan Daniels
6d1b15eab4
[PostEvents] Add event for changing background color (#655) 2024-06-28 09:26:01 -07:00
Tarrgon
0df2e77ab5
[Posts] Generate samples with background color (#649) 2024-06-28 09:13:52 -07:00
Donovan Daniels
4f61a94504
[StaffNotes] Fix body searching (#654) 2024-06-27 16:17:40 -07:00
Donovan Daniels
165cd315e9
[UploadWhitelist] Make upload whitelist case insensitive (#651) 2024-06-27 15:27:08 -07:00
Earlopain
a7ef80074d
[Cleanup] Resolve some easy ruby warnings
Mostly duplicate method warnings
2024-04-28 11:59:37 +02:00
Earlopain
0dce1e50f2
[Users] Add a reasonable length limit on emails
The spec allows for addresses up to 255. A limit of 100 impacts 3 users right now
2024-04-28 11:28:07 +02:00
Earlopain
d01c8c131d
[Misc] Replace httparty with faraday
We already pull in faraday from opensearch-ruby.
httparty hasn't had a release in a while and it printing warnings on ruby 3.3
2024-04-27 23:01:10 +02:00
Earlopain
b058077cf0
[Misc] Add a method that returns the base url for network requests
This makes it easier to stub in tests.
Also add a method to the iqdb proxy to say if it is enabled or not and use it everywhere.
2024-04-26 15:57:56 +02:00
Earlopain
75b618efc7
Merge pull request #634 from DonovanDMC/dmail-blacklist-tags
[DMails] Update "blacklisting user" tags
2024-04-21 19:33:31 +02:00
Earlopain
53d67da88d
[TagImplications] Ignore tag count limit on approve
This will apply to all automated changes, though I think only implications really need it.
2024-04-21 19:09:52 +02:00
Earlopain
8fdeb166df
[Rails] Use modern enum syntax
The current one is deprecated in the next rails version
2024-04-21 18:14:01 +02:00
Earlopain
3229106431
[WikiPages] Fix exception on show_or_new without arg
This now uses `titled` which didn't handle nil
2024-04-12 15:11:45 +02:00
Earlopain
d2d6e83537
[Misc] Fix an exception during exception logging
This broke after the upgrade to rails 7.1 because of https://github.com/rails/rails/pull/46535
2024-04-11 19:10:57 +02:00
Donovan Daniels
8a89377845
[DMails] Update "blacklisting user" tags 2024-04-09 20:44:56 -05:00
Earlopain
0b47770c49
[Prod] Add Datadog
Let's see how this one works out. Cute logo
2024-04-09 20:16:29 +02:00
Earlopain
7cd026d18d
[Cleanup] Return a single wiki from WikiPage.titled 2024-04-09 19:50:33 +02:00
Earlopain
c2574e12d2
[Users] Add profile_about and profile_artinfo to full response 2024-04-05 17:37:39 +02:00
Earlopain
e3fdc5d61b
[Pools] Fix discrepancy between index page count and actual page count
One was using `user.per_page`, the other config.posts_per_page. Consolidate this
logic to `paginate_posts` to make it more obvious what's going on.
2024-04-04 22:52:49 +02:00
Earlopain
aaf1423ef8
[TagAliases] Don't change category on approve for large tags
This has caused trouble on multiple occasions. Right now, a BUR resulted in about 2 million jobs being queued.
1 mil on approve, 1 mil to switch them all back.
2024-03-23 21:24:09 +01:00
Earlopain
e4799d9f83
[Prod] Dump NewRelic
Need to look into alternatives
2024-03-23 20:52:31 +01:00
Earlopain
aeb2076b80
[TagAliases] Fix locked artist preventing approval
Everything is already scoped to the approver. Switching to the creator doesn't make much sense here.

In addition, this sent the success message 5 times because the rename happened at the wrong place
2024-03-17 19:16:01 +01:00
Earlopain
1da52e3d0d
[TagRelations] Fix rejecting in certain cases
Rejection should always be possible
Previously this skipped validations, now it doesn't
2024-03-03 20:35:28 +01:00
Earlopain
d9fe9a7602
[TagRelations] Don't allow multiple rejects from admins 2024-03-03 12:37:40 +01:00
Earlopain
ae105140f1
[BURs] Only allow approving if pending 2024-03-03 12:04:56 +01:00
Earlopain
a3a508c92c
[Takedowns] Fix vericode for frozen string literals
Will add some tests later
2024-02-27 17:32:34 +01:00
Earlopain
4acddd5941
[Admin] Allow searching by exception class 2024-02-27 15:52:38 +01:00
Earlopain
fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00
Earlopain
5140bea658
[Pools] Simplify pool versions post changes
It unconditionally took values from the passed pool version
2024-02-25 14:14:30 +01:00
Earlopain
930b4b905c
[Pools] Fix show/gallery for frozen string literals
Get rid of the presenters/post sets.
2024-02-25 11:38:55 +01:00
Earlopain
0381653e80
[Pools] Use paginate method for posts 2024-02-24 19:57:29 +01:00
Earlopain
b02b2353e7
[Pools] Always disallow duplicate posts
20 pools have this, 18 of those by accident. Series/collection distinction makes little sense for e6
2024-02-24 19:05:48 +01:00
Earlopain
5a139969dd
[Users] Move view-only code to helper 2024-02-23 17:23:25 +01:00
Earlopain
6c623496a2
[Users] Stop using has_mail bitflag 2024-02-23 17:18:22 +01:00
Earlopain
b042ce8dd0
[Users] Don't automatically add all boolean attributes to json 2024-02-23 17:11:40 +01:00
Earlopain
457c59c3c6
[Users] Mark unused bitprefs via underscore 2024-02-23 17:06:50 +01:00
Earlopain
56e849695b
[Cleanup] Remove readonly only
Since its introduction 3 years ago, it got used once I believe
I can't even say if this properly works anymore.

If something like that is actually desired in the future, it should just be a whitelist instead
2024-02-23 16:48:56 +01:00
Donovan Daniels
6b2b2cfc14
[DMails] Add marking as unread (#620)
* [DMails] Add marking as unread

* Tweak wording to be same as "Mark all as read", dmail capitalization
2024-02-23 16:39:59 +01:00
Earlopain
f59399ed67
[TagRelationships] Fix aliases/implications being left in queued state
This wasn't going through the error handler
2024-02-22 17:38:51 +01:00
Earlopain
c9fa546fb3
[Cleanup] Remove deny_transitives from tag alias approve!
Passing true would error because the error class doesn't exist.
BURs check this condition right before.
2024-02-17 12:12:39 +01:00
Earlopain
16de61c044
[Help] Sort entries by their displayed title 2024-02-15 20:11:44 +01:00
Earlopain
069a009dde
[Cleanup] Refactor help pages
The code wasn't very easy to follow. Uses the hip new normalized method from Rails 7.1
Adds some barebones tests
2024-02-15 20:05:36 +01:00
Earlopain
43ade626e0
[AIBUR] Fix ModActions for implications and on alias reject 2024-02-15 16:58:47 +01:00
Donovan Daniels
b89fc1428e
[Comments] Add "Post Uploader" to search options (#598)
* [Comments] Add "Post Uploader" to search options

* Use block with where_user
2024-02-14 16:10:45 +01:00
Earlopain
1c53597178
Merge branch 'master' into rails-7.1 2024-01-27 14:05:08 +01:00
Sindrake
2b3c9c3a10 [Comments] Fix the show_hidden_comments setting 2024-01-26 07:45:55 -08:00
Earlopain
a7228612a2
[Rails] Update to 7.1
Run `app:update`, fix the one deprecation warning
2024-01-25 22:05:29 +01:00
Earlopain
0fad5d5659
[Comments] Fix exception when searching by poster_id
Caused by 2c832dc633
poster_id requires a join and these columns weren't fully qualified.
2024-01-25 18:47:26 +01:00
Earlopain
2c832dc633
[Comments] Show hidden sticky comments to Janitors 2024-01-22 19:26:00 +01:00
Earlopain
9ec5ab3e1d
[Comments] Simplify hidden method
Instead of having the cognitive load of checking if this is indeed the inverse of `visible`, just wrap it all in sql not
I'd love to have rails take care of this but haven't found something for that
2024-01-22 19:20:40 +01:00
Earlopain
c4bd8e961f
[Comments] Simplify should_see? 2024-01-22 18:57:44 +01:00
Donovan Daniels
465a91a69f
[PostVersions] Allow searching for only uploads (#595)
* [PostVersions] Allow searching for only uploads

* include_blank: true
2024-01-22 17:30:42 +01:00
Earlopain
1b982f64e1
[PostVersions] Downcase tag query
Allows searches like `Hi_res` to function
2024-01-21 17:56:47 +01:00
Earlopain
ae96db548e
[Cleanup] Avoid nested methods
These are redefined every time the enclosing method is called
2024-01-21 17:55:11 +01:00
Donovan Daniels
8f8feac8aa
[Artists] Show error when changing notes with locked wiki page (#580)
* [Artists] Show error when changing notes with locked wiki page

* [Tests] Add tests for editing artists with locked wiki pages
2024-01-14 21:01:01 +01:00
Earlopain
1fed677a45
[Tickets] Make response mandatory 2024-01-14 12:36:37 +01:00
Earlopain
2c03ccf681
Merge pull request #581 from DonovanDMC/add-user-feedback-updater
[UserFeedback] Add Updater
2024-01-11 17:29:45 +01:00
Donovan Daniels
c11ad6b874
[UserFeedback] Add Updater 2024-01-04 14:31:54 -06:00
Donovan Daniels
bce86389b0
[Uploads] Fix parent_id search 2023-12-22 19:13:52 -06:00
Earlopain
c66e7c1f34
[Uploads] Allow underscore in whitelist entry 2023-12-17 20:16:58 +01:00
Earlopain
16014a438f
[Dmails] Partially enable api
Basically everything except sending
2023-12-17 19:55:13 +01:00
Donovan Daniels
74007f2e30
[Blips] Add Updater & Tests/Move modactions to callbacks (#540)
* [Blips] Add `updater_id` & update notice

* [Blips] Move modaction generation logic into rails callbacks

* [Tests] Add blip tests

* Move update notice to right place

* Assert amount of difference

* Rebase oopsie

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-12-04 20:56:14 +01:00
Donovan Daniels
fd5b491694
[UserWarnable] Fix warning_user_id never being set (#541)
* [UserWarnable] fix `warning_user_id` never being set
I know `update` & `update_columns` function differently, but I feel the difference isn't needed

* [UserWarnable] Add inline user and timestamp

* lint

* Move warning info into partial

Also removes the user/timestamp as that is redundant for now

* Fix unmarking

* Tweak fixer script

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-12-04 20:19:49 +01:00
Donovan Daniels
6eaf435002
Bring ForumPost ModAction trigger in line with Comments (#542)
* [Tests] Add hide & delete modaction tests to comments and forum posts

* [ForumPosts] Remove user id check on destroy

* [ForumPosts] Don't create edit modaction on hide

* Assert correct amount of ModActions is created

Especially important when it previously created 2 instead of 1 for hiding

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-12-04 19:41:29 +01:00
Donovan Daniels
b330a5f579
[ModActions] Ban Update Mod Action (#539)
* [ModActions] Ban Update Mod Action

* Add back accidentally removed newline

* Log expiration for user_ban_update ModAction

The duration in days makes sense on creation but it falls apart when updating
For this to correctly work the duration needs to be persisted as well
which it isn't at the moment.

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-12-04 19:09:35 +01:00
Donovan Daniels
10e9304f17
[ForumPosts] Check for existence of topic & category (#524)
* [ForumPosts] Check for existence of topic & category

* [Tests] Add invalid topic category_id test

* Tweak how it is getting validated

If the category doesn't exist there's not point in doing anything further

* Move response assert before the other one

Should always be that way. If the response doesn't have the expected format
the assert will for sure fail and produce a confusing error message

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-12-04 18:03:11 +01:00
Earlopain
6bb4c272cc
[Gems] Bump rubocop 2023-12-03 15:36:37 +01:00
Earlopain
22ad22da16
[Cleanup] Order user has_many relations 2023-11-14 21:20:33 +01:00
Earlopain
9b8344d943
[Wiki] Only validate title if it changed
See b08d5e6970 (commitcomment-132379723)
2023-11-13 16:55:40 +01:00
Earlopain
57d5d58ad7
[Users] Inform about currently invalid names
Number only names especially interfere with the search syntax
2023-11-12 21:04:51 +01:00
Earlopain
b08d5e6970
[Wiki] Ensure titles follow tag name restrictions 2023-11-12 19:31:03 +01:00
Earlopain
f8098721ec
[Misc] Remove memoist gem dependency
The author has passed away and  some functionality is broken with recent
ruby versions already. We only use a subset of it, so it's easy to replace.

Some places:
* Didn't even use it
* Used it but the method was already cached through memcached
* Just don't need it

Some places I question if it is needed but I'll just leave them there
since I don't want to benchmark
2023-11-08 22:21:11 +01:00
Earlopain
e4ce4f312f
[PostVersions] Remove code for handling nil posts
The post_id column is not nullable
2023-11-08 22:11:46 +01:00
Earlopain
3373dd51de
[PostVersions] Organize api only methods
Remove memoization, they are only called once
Remove the two with_fields methods as they are unused
2023-11-08 20:13:53 +01:00
faucet
8ed5875a74
[Artists] Correct bsky domain for priority list 2023-11-01 20:19:24 +00:00
Earlopain
6a73273f67
[Takedowns] Strip email and source field 2023-10-30 16:25:20 +01:00
Earlopain
d95a0e5e10
[Uploads] Remove md5_confirmation
It's broken. Closes #552
TODO: Remove upload column
2023-10-16 20:11:03 +02:00
Earlopain
4a26251e77
[Mascots] Fix handling of app names with spaces in them
Use comma as a separator instead.
Closes #551
2023-10-15 19:14:21 +02:00
Earlopain
83f160e3a9
[Comments] Move recent count into constant 2023-10-15 18:01:23 +02:00
Earlopain
61a0a6518a
[Artists] Add a bunch of domains to the priority list 2023-10-15 17:11:43 +02:00
Earlopain
0d94e076a1
[User] Don't count replacement backups against upload limit 2023-10-15 14:16:23 +02:00
Earlopain
81ab93b7ee
[Takedowns] Fix adding by tag search
Broken with b4e16fa0fd
2023-09-21 19:06:18 +02:00
Earlopain
a0c56446fa
Merge pull request #548 from e621ng/remove-elasticsearch-model
Remove elasticsearch-model
2023-09-18 20:29:56 +02:00
Earlopain
26ed6928ba
[Dmails] Tweak rate limit
* Lower hourly limit
* Add daily limit
2023-09-17 17:57:17 +02:00
Earlopain
632b611c4c
[Dmails] Fix senders copy being created when validations fail 2023-09-17 16:40:33 +02:00
Earlopain
9e2c7b2b5b
[Cleanup] Remove ban check when sending dmails
Banned users can't login in the first place
2023-09-17 14:38:43 +02:00
Earlopain
0bd651c08b
[Elasticsearch] Remove elasticsearch-model gem
This should be the bulk of the work to integrate with opensearch-ruby
2023-09-16 15:52:05 +02:00
Earlopain
b4e16fa0fd
[Elasticsearch] Implement Response 2023-09-16 15:30:28 +02:00
Earlopain
7c7c2f1870
[Users] Add a size limit to the body of feedback 2023-09-12 19:09:17 +02:00
Earlopain
056ce3e7aa
[Cleanup] Remove without_safe_mode from CurrentUser
It really did two things and was primarily intented for automated actions
so that all posts get matched regardless of rating and status.
Now there's a dedicated method to do just that
2023-09-11 18:30:25 +02:00
Earlopain
f6a438a302
[Tickets] Fix error when creating tickets for non-existant content 2023-09-07 17:08:52 +02:00
Donovan Daniels
115c140cc2
[Posts] Make comment_disabled not hide comments (#546)
* [Posts] Make comment_disabled not hide comments

* [VoteManager] Disallow voting on locked/disabled comments

* [Comments] Disable editing/hiding disabled & locked comments

* Tweaking

* Allow hiding when comments locked
* Don't allow mods to vote when comments locked
* Change wording from disabled to locked everywhere

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-09-05 17:27:05 +02:00
Earlopain
1b9ea498d3
[TagQuery] Move more stuff into the base elastic class 2023-09-05 16:03:13 +02:00