Commit Graph

1329 Commits

Author SHA1 Message Date
Earlopain
9d1d195fa2
[Cleanup] Remove a bunch of code around is_single_tag?
That method will never return true because status:deleted is getting appended.

Also remove a bunch of related_tags code.
It was either calculate_related_tags_from_post_set or related_tags_for_group.
The results from calculate_related_tags_from_post_set look good in every case,
I can't tell one over the other. This one should be more efficient, since
it doesn't have to do an extra post search.
2023-02-24 23:26:07 +01:00
Earlopain
02a4051031
[Tests] Be explitic about where jobs need to be inlined 2023-02-24 14:14:44 +01:00
Earlopain
5215876862
[DB] Remove usage of dedicated index columns
The index for posts is also getting added, but will get used at a later date
If this turns out to work fine the materialized index colums can be dropped

This contains a semantic change where dmail and wiki page searches for the body
no longer includes matches for the title
2023-02-19 20:01:54 +01:00
Earlopain
902e35673f
[Posts] Relax voting isolation level and remove lock
"The serialization of the vote and favorite actions was likely excessive
 even in the production configuration, and it has been relaxed to use
 repeatable_read in this implementation. The locks on rows were also
 removed as they do not have strict locking requirements with this transaction
 level to my knowledge."
2023-01-28 15:37:20 +01:00
Earlopain
690750d020
[Posts] Allow guidelines flag in more cases for priv+ 2023-01-27 22:25:48 +01:00
Earlopain
ead6d0919e
[PostFlags] Remove test reason 2023-01-26 21:44:00 +01:00
Earlopain
f6b53dd0d3
Merge branch 'moderator-role' 2023-01-11 17:05:37 +01:00
Earlopain
76f54e32b9
[BURs] Remove another unused import parameter
Was only possible to set to false on the previously removed import page.
2022-12-26 20:36:53 +01:00
Earlopain
e3b02a7f96
[BURs] Rename importer class 2022-12-26 20:21:33 +01:00
Earlopain
f08a094ea2
[BURs] Remove unused first parameter for import 2022-12-26 20:09:32 +01:00
Earlopain
b6f006a353
[Cleanup] Remove forum topic merging 2022-12-23 16:58:32 +01:00
Earlopain
e262f06a93
[Cleanup] Remove NoteSanizier
Notes are formatted using dtext only. Even though the existance of this
class suggests that some html elements are allowed, it doesn't actually do anything.
Link relativization also didn't work, same with dtext colors.
2022-12-17 17:00:27 +01:00
Earlopain
cb3d34b650
[Cleanup] Use the same method names for Cache as Rails 2022-11-29 19:14:09 +01:00
Earlopain
7a028cf003
[Tests] Set CurrentUser.ip_addr in base setup 2022-11-26 16:20:16 +01:00
Earlopain
c68fdfce2b
[Tests] Always use CurrentUser as helper 2022-11-26 15:20:15 +01:00
Earlopain
20ef412b68
[Cleanup] Remove CurrentUser.root_url 2022-11-26 14:43:43 +01:00
Earlopain
98e55562eb
[Tests] Clean up teardowns 2022-11-26 14:02:06 +01:00
Earlopain
918a3f491d
[Tests] Remove useless travel_to 2022-11-26 13:52:37 +01:00
Earlopain
e0819dfd5f
[Tests] Remove as_admin helper 2022-11-26 12:37:22 +01:00
Earlopain
87313c437c [Tests] Include FactoryBot::Syntax::Methods
The newly included create method behaves exacly like the self-written one,
with the added benefit of it not appearing in backtraces.
2022-11-25 21:06:54 +01:00
Earlopain
b690177f07 [Tests] Remove useless stub 2022-11-25 20:09:24 +01:00
Earlopain
00c1dc27e1
[Tests] Use file_fixture/fixture_file_upload 2022-11-25 18:44:36 +01:00
Earlopain
04b18d0852
[Tests] Disallow and stub all requests being made
Make CloudflareService a module for easier stubbing
2022-11-25 17:27:38 +01:00
Earlopain
c9f65608de
[Tests] Replace timecop with native Rails method
Also removes it at a bunch of places where it's not needed
2022-11-25 14:32:56 +01:00
Earlopain
6214cbd16e
[Cleanup] Remove more pool post set code 2022-10-19 18:15:00 +02:00
Earlopain
27371dfc84
Merge pull request #440 from zwagoth/votes
Votes
2022-10-13 21:44:03 +02:00
Earlopain
c2adf1bf31
[Users] Reset account level on deletion 2022-10-13 18:37:52 +02:00
Earlopain
e7b155cb85
[Cleanup] Remove where_regex
Only artist_url matching was using this.
2022-10-13 18:22:07 +02:00
Earlopain
696ae62ef6
[Votes] Deduplicate Comment/Post vote code 2022-10-08 12:04:17 +02:00
Earlopain
33dba98cf5
[Cleanup] Simplify/Remove some post set code 2022-09-30 14:23:54 +02:00
Earlopain
999e410665
[Tests] A bunch of fixes, again 2022-10-01 19:11:46 +02:00
Earlopain
8a6fb57cc2
[Tests] Remove note_count 2022-10-01 19:11:40 +02:00
Earlopain
6801742487
[Cleanup] Remove promote message code 2022-09-26 20:20:20 +02:00
Earlopain
3fe4b718cc
[Posts] Prevent adding specific tags when base tag is locked
Closes #399
2022-09-24 20:43:49 +02:00
Earlopain
9089290eb5
[Tests] Fix not reloading post to update is_flagged 2022-09-24 20:43:48 +02:00
Kira
fb1fb87047 [Posts] When approving your own uploads, don't increment approval count
This brings the behavior of approvals on your own uploads in line with uploading
with the automatic approvals enabled.
2022-09-20 02:13:00 -07:00
Kira
d56334ea4c [Posts] Prevent automatic flag removal when approving posts
In order to prevent mistakes where posts are approved from the index page
flags are no longer automatically resolved on approval.

This does not modify the approval behavior of clearing flags from the post
page itself, where the action is explicitly performed by jan+.
2022-09-20 02:08:45 -07:00
Earlopain
e1e9324c84
[Tests] A few fixes 2022-09-17 19:32:21 +02:00
Earlopain
34bece584c
[Posts] Simplify tag list generation
There were a bunch of parameters being passed around, now there aren't.
Also gave the methods more descriptive names.
2022-09-17 13:18:33 +02:00
Earlopain
94e3dac343
[TagAliases] Don't change category of the target tag when non-general on approve 2022-09-16 19:22:28 +02:00
Earlopain
0cd5391d3c
[Users] Fix double dot in account to new message 2022-09-11 18:54:43 +02:00
Earlopain
b78d55fdd3
[Posts] Add new flag reason for pending posts 2022-08-20 18:19:08 +02:00
Earlopain
0a03bea16c
Merge branch 'master' into pools-is-deleted 2022-08-07 16:29:47 +02:00
Earlopain
4cb88300c7
[Versions] Rename post/pool archive classes to versions
This just makes sense, and was confusing beforehand.
Case-in-point: Two test classes for pools: pool_versions and pool_archive
2022-08-06 18:58:24 +02:00
Earlopain
7e33ea8271
[Cleanup] Remove pool is_deleted
Pools are hard-deleted now. There are also a few pools with this flag
which can't be properly deleted at the moment
2022-07-11 22:52:26 +02:00
Earlopain
7531fc9894
[Cleanup] Remove an assortment of unused code 2022-07-11 20:17:24 +02:00
Earlopain
2b8173e05a
[Tests] Small amount of fixes 2022-05-26 22:49:43 +02:00
Earlopain
10cc7e7dba
[Cleanup] Remove iqdb test helper 2022-05-26 19:35:46 +02:00
Earlopain
3b714dd726
[EmailBlacklist] Only unverify exact domain matches 2022-05-23 08:10:54 +02:00
Earlopain
b2a733d0c4
[Replacements] Fix duration when replacing gif -> webm 2022-05-22 21:39:21 +02:00
Earlopain
3187ee169b
[TagRelations] Require a reason on create 2022-05-22 18:59:45 +02:00
Earlopain
98ab543e59
[TagRelations] Refactor alias/implication request code 2022-05-22 17:05:12 +02:00
Earlopain
3108613b0e
[EmailBlacklist] Unverify existing users on create 2022-05-22 15:21:41 +02:00
Earlopain
2b079eabb9
[PostEvent] Fix unflag event on approve not being created 2022-05-22 14:47:11 +02:00
Earlopain
93cd28c0e1
[Posts] Change comment locked to disabled
Instead of just preventing new comments hide everything completly.
2022-05-16 15:53:39 +02:00
Earlopain
2f5b55a0bc
[Comments] Hide a few buttons on sticky 2022-05-16 14:42:44 +02:00
Earlopain
6d3f272e90
[Posts] Allow locking comment sections 2022-05-16 14:20:11 +02:00
Earlopain
c9f14e7836
[Replacements] Run full file validation on create 2022-05-08 20:47:11 +02:00
Jason Gronn
23253d6766
[Comments] Disable downvoting own comment (#397)
* Disable downvoting own comment; hide vote buttons for own comment

* Revert hiding buttons; merge upvote/downvote paths; fix tests that relied on previous behaviour

* Undo some changes I did not mean to make

* Fix a mistake I made

* Fix some other unit tests
2022-04-30 12:48:53 +02:00
Earlopain
e18a2602b6
[Tests] Small amount of fixes 2022-04-21 21:23:33 +02:00
Earlopain
20146b106d
[Tests] A bunch of more fixes 2022-04-13 08:54:50 +02:00
Earlopain
0e60ac29f9
[Cleanup] Remove mb_chars usage
Ruby 2.4 supports this natively
2022-04-09 14:23:12 +02:00
Earlopain
029fabc279
[Cleanup] Remove merge_version? 2022-04-08 11:49:58 +02:00
Earlopain
0d50202bbd
[Tests] Fix a bunch
1269 runs, 2237 assertions, 68 failures, 27 errors, 0 skips
2022-04-07 18:23:20 +02:00
Earlopain
10d09700fb
[Cleanup] Remove TagChangeNoticeService 2022-04-07 18:14:15 +02:00
Earlopain
841610cd90
[Tests] Fix a few tests related to elasticsearch
Namespace the indicies, this should stop the search being messed up
after running tests. Also refresh the index immediately, this slows down
tests a bit but gets rid of a few failures. This whole search testing needs
to be revised some time.

Run this to fix your development setup:
```
Post.__elasticsearch__.create_index!
Post.import
PostArchive.__elasticsearch__.create_index!
PostArchive.import
```
2022-04-05 19:24:31 +02:00
Earlopain
3740599920
[Tests] Fix a bunch of tests 2022-04-05 18:50:34 +02:00
Earlopain
4c44b3aa32
[Search] Remove instance variables named search
They seem to have special meaning in `simple_form_for?`
2022-04-02 17:43:16 +02:00
Earlopain
f7d1ad0810
[Tests] Fix apng tests 2022-03-29 19:40:01 +02:00
Earlopain
ec559f1a34
[Tests] Fix some comment tests 2022-03-28 21:17:34 +02:00
Earlopain
d4d37a7cd2
[Tests] Remove unused tests
Looks like I forgot to remove this some time.
Also remove stray `puts`
2022-03-21 15:39:27 +01:00
Earlopain
92a0a36589
[Cleanup] Remove upload referer_url 2022-03-16 17:39:58 +01:00
Earlopain
3aa731c408
[Cleanup] Don't return strategy on download 2022-03-16 17:15:45 +01:00
Earlopain
ee8fb64861
[Cleanup] Remove ugoira 2022-03-16 17:08:40 +01:00
Earlopain
2b84f3a4cd
[Tests] Fix disapproval tests
Also updates the reason search dropdown
2022-03-16 15:55:24 +01:00
Earlopain
dd8aa8199b
[Cleanup] Remove modqueue random 2022-03-16 15:48:29 +01:00
Earlopain
55443873a3
[Cleanup] Remove no_feedback 2022-03-16 15:32:24 +01:00
Earlopain
6902434a90
[Replacements] Remove hourly limit
The normal upload limit is still in effect though.
Fixes #379 by completly ignoring the actual problem.
2022-03-05 17:23:53 +01:00
Earlopain
5a88be7d2d
[Cleanup] Remove spam detection
Checked for is_gold, which doesn't work anyways
2022-03-05 16:05:53 +01:00
Earlopain
e01ab43577
[Cleanup] Remove janitor trials 2022-03-05 15:58:30 +01:00
Earlopain
8007881660
[Tests] Fix some password reset tests 2022-02-19 17:34:50 +01:00
Earlopain
2802623642
[Tests] Fix post flag tests 2022-02-19 17:34:14 +01:00
Earlopain
de0311a268
[Cleanup] Remove a few unused files 2022-02-19 17:19:44 +01:00
Earlopain
348827de5d
[Tests] Fix artist tests 2022-02-19 17:07:58 +01:00
Earlopain
e3728546c7
[Cleanup] Remove artist banning 2022-02-19 16:54:26 +01:00
Earlopain
2d94167fab
[Cleanup] Remove Artist.new_with_defaults 2022-02-19 16:04:33 +01:00
Earlopain
ac5e8673ca
[Cleanup] Remove most source strategy code 2022-02-19 15:55:26 +01:00
Earlopain
451e23c121
[Cleanup] Remove dead related tags code 2022-02-19 14:11:49 +01:00
Zwagoth
91d32607f0
Merge pull request #375 from zwagoth/remove-appeals
[Cleanup] Remove post appeals
2022-02-19 02:22:25 -05:00
Earlopain
f7ba9c5043
[Cleanup] Remove post appeals 2022-02-11 17:05:09 +01:00
Earlopain
924e519b4c
[Tests] Fix user feedback tests 2022-02-10 17:58:20 +01:00
Earlopain
c6dae231f0
[Tests] Remove remaining sqs stubs 2022-02-10 17:55:48 +01:00
Earlopain
b1a8c4960c
[Tests] Fix pool tests 2022-02-10 17:53:51 +01:00
Earlopain
533b2c5c1c
[Cleanup] Remove unused maintenance tasks 2022-02-09 15:41:15 +01:00
Earlopain
7aa6adeae4
[Cleanup] Remove donmai specifics 2022-02-09 15:39:18 +01:00
Earlopain
a135c2a592
[Cleanup] Remove reportbooru 2022-02-09 15:39:07 +01:00
Earlopain
5ebc8756c9
[Cleanup] Remove more danbooru specific code 2022-02-03 16:41:10 +01:00
Earlopain
6f8b4001e0
[Cleanup] Remove danbooru cloudflare purge cache functionality 2021-11-20 21:18:29 +01:00
Earlopain
ca370d29be
[Posts] Remove dead source normalization code 2021-11-20 21:49:53 +01:00
Zwagoth
37a9137096
Merge pull request #364 from zwagoth/post-events-log
Post events log
2022-01-31 13:05:05 -05:00
Earlopain
1c6b2dcba9
[Users] Remove special casing for name change feedback
Part of old danbooru code, these feedbacks where never created on e6.
Also remove name change approve/reject controller actions, it's all automatic
2022-01-22 16:20:49 +01:00
Earlopain
22d04f6cb1
[Posts] Add postevent tests 2022-01-07 12:29:11 +01:00
Earlopain
bcccec6778
[Replacements] Add test for upload limit changes 2021-06-27 00:21:01 +02:00
Zwagoth
b2b5938d5c
Merge pull request #325 from zwagoth/replacement-search
[Search] Add pending replacements field
2021-11-17 00:44:19 -05:00
Earlopain
061176e095
[Setup] Ignore limits when seeding
This makes the environment config understand booleans. If something
ends with "?" it tries to interpret it as a boolean. A bunch of
existing configs where changed to reflect this change.
2021-11-14 22:16:36 +01:00
Earlopain
572b61c85c
[Forum] Prevent voting on your own requests
Removing the votes is still possible but adding new ones  isn't.
Closes #341
2021-11-02 16:36:05 +01:00
Earlopain
147ec019e8
[Search] Add pending replacements field 2021-10-05 21:14:00 +02:00
Earlopain
1c0c3c2475
[Flags] Allow viewing flags on own uploaded posts
Apparently  this was a attempt to hide some undesirable information from mods
I personally think this isn't needed and if someone really wanted to
they could just use the other search options which didn't have this limitation
2021-08-06 19:54:18 +02:00
Earlopain
4b7242005a
[Replacements] Fix broken state when rescaling notes
After the note will be saved it reloaded the post, throwing the
previous changes like new md5, size etc. away
2021-06-24 16:22:04 +02:00
Earlopain
eb1f432fc5
Merge branch 'master' into style-changes 2021-06-02 14:28:22 +02:00
Earlopain
8d8a0802a5
[User] Remove memoization of throttles
This interfered with tests and doesn't seem to give much of an advantage
2021-05-15 12:36:29 +02:00
Earlopain
9df05e7ba8
[Tests] Add test for forum post throttles 2021-05-14 17:54:46 +02:00
Earlopain
11f4b5e15b
[Tests] Fix user tests 2021-05-14 17:12:51 +02:00
Earlopain
015c238dca
[Config] Remove member_comment_time_threshold
This was only stubbed in tests and not used anywhere else
2021-05-14 17:07:43 +02:00
Earlopain
a023c2806e
[Tests] Fix forum post/topic tests 2021-05-14 15:04:03 +02:00
Earlopain
bb56d14221
[Favorites] Use limit parameter and update tests
Some tests still fail because of is_last_page/is_first_page, but the syntax is fine now

Fixes #267
2021-05-09 18:57:01 +02:00
Zwagoth
af7f7f9d10
Merge pull request #256 from Earlopain/remove-useless-config
Remove useless config entries
2021-04-18 17:41:12 -04:00
Kira
96c7a76bb8 [Replacements] Do not post comment on replacement 2021-04-16 18:05:22 -07:00
Kira
3bcaa6dacf [Replacement] Add post replacement promote test 2021-04-07 10:33:19 -07:00
Kira
173294fb56 [Replacements] Testing 2021-04-07 10:33:19 -07:00
Kira
2298beaa6c [Tests] Fix post replacement controller tests 2021-04-07 10:33:19 -07:00
Kira
c2e6b16796 Tests and fixes 2021-04-07 10:33:18 -07:00
Earlopain
e7b03a84e9
[Config] remove dead keys 2021-04-03 20:14:15 +02:00
Kira
8ea9419045 [Pools] Fix pool name validator for '_-_'
A bad regex was added which was flagging pool names as invalid
if they contained _-_ in them or ' - '. As these are heavily used
in pool names they should be allowed. But consequitive characters
should still be not allowed.
2021-03-11 00:06:20 -08:00
Kira
5c90693338 [Posts] Allow copying source/tags on delete 2021-03-10 22:39:12 -08:00
Kira
9c6939c302 [Tag Aliases] Don't update locked tag categories on alias approval. 2021-02-28 13:30:28 -08:00
Kira
784890ca3e [Posts] Fix tag set presenter using broken memoist gem 2021-02-25 12:08:09 -08:00
Kira
76d1999ade [Rails] Upgrade to rails 6.1 + fix tests 2021-02-25 12:08:09 -08:00
Kira
e685fb87c2 [Tests] Update tests and fix deprecations 2021-02-25 12:08:09 -08:00
Kira
12cdec9642 [Tests] Remove test for removed class 2021-02-25 12:08:09 -08:00
Kira
fd635ff197 [Tests] Fix vote tests 2021-02-25 12:08:09 -08:00
Kira
e2a7fa1e27 [Tests] Fix favorite tests 2021-02-25 12:08:09 -08:00
Kira
2f416b51b4 [Tests] Fix pool tests
The atomic add! and remove! methods were not properly resetting
the skip_sync property once the pool was updated. This was causing
pool test behavior to fail because later syncronize methods would
fail to sync.
2021-02-25 12:08:09 -08:00
Kira
dbb5870d93 [Tests] Fix pool related errors in tests 2021-02-25 12:08:09 -08:00
Kira
46fe5f1164 [Pools] Pool tests 2021-02-25 12:08:09 -08:00
Kira
c246cd68a2 More test fixes 2021-02-25 12:08:08 -08:00
Kira
8364af65c5 More test fixing 2021-02-25 12:08:08 -08:00
Kira
58e8fe22fd Tests and fixes 2021-02-25 12:08:08 -08:00
Kira
32e81770ef Update tests 2021-02-25 12:00:09 -08:00
Kira
4d996fed54 Update allowed tag naming patterns 2020-12-20 11:31:52 -08:00
Kira
3d82cc3430 [Tag Relations] Remove secondary validations 2020-07-17 01:34:12 -07:00
Kira
160b0cb22e Remove saved searches 2019-10-21 02:57:03 -07:00
Kira
6f74ef28bf Remove broken bulk revert tool 2019-09-28 22:10:23 -07:00
Kira
6fb1e3ceaf Fix up users being broken in tests and fix a few basic tests 2019-09-09 12:58:18 -07:00
Kira
55cb64acf7 Fix deprecated use of update_attributes 2019-09-09 12:58:18 -07:00
evazion
aae3a8edfb artists: reduce queries in artist summaries.
Avoid a few queries when searching for single artist tags.
2019-09-05 06:03:33 -07:00
evazion
ae5d039745 app controller: move safe mode from app controller to SessionLoader. 2019-08-28 21:09:37 -07:00
evazion
4e39ef572e Fix #4125: Detect forum and comment spam. 2019-08-28 20:51:14 -07:00
evazion
30ee20a570 dmails: factor out spam detector service. 2019-08-28 20:48:31 -07:00
evazion
531b5c9845 models: drop various unused #named methods. 2019-08-18 13:35:11 -07:00