Commit Graph
1357 Commits
Author SHA1 Message Date
evazion 7c8c4e9f82 tests: fix null uploader_ip_addr exceptions in create(:post).
Caused by a change in FactoryBot 5. Associations in factories are now
constructed using the same strategy as the base object, meaning that
using `build` to construct an object will also construct the
associations using `build`. This meant that overriding `create` to do
`build` + `save` broke the way that associations were constructed.

https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#associations
2019-08-04 12:43:12 -05:00
evazion 39bd766b34 Fix #4053: Add disapproval index improvements.
Add search form to /moderator/post/disapprovals.
2019-08-02 22:03:03 -05:00
evazion 6c69165780 Fix #4105: IP bans leak banned IPs in /mod_actions. 2019-08-01 21:21:18 -05:00
evazion 065609ff4f artists: prevent creating artist entries for non-artist tags (#4107, 2717).
Validate that artist entries belong to an artist tag. Don't allow
creating artist entries for character/copyright/meta tags, but do allow
entries for general tags (the gentag will be automatically changed to an
artist tag).
2019-08-01 20:20:06 -05:00
evazion bcaefa0a7e Fix #4107: Can't create artist entry if tag already has a wiki #4107 2019-08-01 19:34:21 -05:00
Albert Yi f95bcc7330 move safe_mode from Thread.current to RequestStore 2019-06-26 09:26:20 -07:00
Albert Yi 0a058dd52b fixes #4080: Status code 500 when disapproving through API 2019-05-17 12:09:03 -07:00
Albert Yi 04edc3f533 update factories + tests 2019-05-10 17:31:07 -07:00
Albert Yi 32b4e0a01e update gems 2019-05-10 16:46:26 -07:00
Albert Yi 6612aa1af9 fix unit tests 2019-04-25 18:13:59 -07:00
Albert Yi c18cf5480d update uploadcontroller test 2019-04-16 16:26:38 -07:00
Albert Yi 6f4ca75bb1 try to handle deivantart images hosted on images-wixmp better 2019-04-16 13:55:26 -07:00
Albert Yi eb8ce2e955 Revert "eliminate old algorithm for deviant art sources, fix canonical_url on deviantart"
This reverts commit 58ca52b43e.
2019-04-16 13:22:09 -07:00
Albert Yi 58ca52b43e eliminate old algorithm for deviant art sources, fix canonical_url on deviantart 2019-04-12 16:35:41 -07:00
Albert Yi f6a11e6363 remove residual code 2019-02-25 14:46:43 -08:00
Albert Yi 90ce42a537 add support for nico seiga manga (fixes #4060) 2019-02-25 14:44:45 -08:00
Albert Yi d8aabff77b remove post keeper references 2019-01-31 15:45:06 -08:00
Albert Yi 33063a72de Add a listing page for post disapprovals (accessible to approvers only) 2019-01-24 16:14:57 -08:00
Albert Yi 1550538dc1 Tag change notices
This adds a small notice at the bottom of post searches if a single tag search is the target of any tag change request.
2019-01-22 17:22:07 -08:00
evazion 8cadef2dd7 pixiv: fix illust id parsing (fix #4043).
* Tighten up illust id parsing to avoid misparsing ids from
  non-illust urls (sketch urls and novel urls).

* Move id parsing tests from post_test.rb to sources/pixiv_test.rb.

* Drop support for touch.pixiv.net urls. These urls are no longer used
  by Pixiv and aren't present as the source of any posts on Danbooru.
2019-01-13 14:28:51 -06:00
Albert Yi f33b23d035 add post count estimates for bulk update requests 2019-01-09 15:54:55 -08:00
Albert Yi 844b1a81ba Merge pull request #4039 from evazion/fix-4038
Fix #4038: Attempting to create an IP-ban bans the creator.
2019-01-09 14:47:32 -08:00
Albert Yi d97622d1bb Merge pull request #4007 from evazion/fix-4004
Fix #4004: Add additional order by metatags for posts
2019-01-09 14:43:15 -08:00
evazion 80f43f9a7c Fix #4038: Attempting to create an IP-ban bans the creator.
* Rename comments.ip_addr to comments.creator_ip_addr.
* Fix belongs_to_creator to not clobber ip_addr field.
2019-01-09 16:20:34 -06:00
Albert Yi 8b0af19f7f fixes #3824: render tag requests dynamically in the forum post
refactoring
2019-01-08 12:57:37 -08:00
evazion 5c54c61d65 Fix #4035: The Related Tag JSON endpoint is returning the wrong information
* Fix /related_tags.json to return a list of tags in the `other_wikis` field.

* Add support for /related_tags.xml.
2019-01-07 13:30:10 -06:00
evazion 04d5b16da7 pixiv: fix failure to upload bad pixiv id images (fix #4031)
Bug: Uploading bad pixiv id images failed because the pixiv strategy
raised a BadIDError exception when the upload service checked for the
ugoira frame data.
2019-01-03 18:01:20 -06:00
evazion 886096b47a BURs: fix remove alias command removing inactive aliases.
Fix the `remove alias` and `remove implication` commands to only remove
active aliases or implications, not pending/deleted/retired ones.
2019-01-03 16:30:39 -06:00
Albert Yi f78ff57884 fix forum topic test 2019-01-02 12:33:56 -08:00
Albert Yi 6f30c99ac3 fix tag alias correction tests
also removes references to distributed memcached servers in tag alias correction
2019-01-02 11:52:35 -08:00
evazion d32882e1ee aliases/implications: fix controller tests. 2018-12-31 19:08:15 -06:00
evazion d393d67a9b aliases/implications: don't destroy removed aliases (#4024). 2018-12-31 17:07:14 -06:00
evazion f5116c5ce2 aliases/implications: allow duplicate inactive aliases/implications.
Allow multiple pending, deleted or retired aliases/implications for the
same tag.

This is so that deleted or retired aliases can be resubmitted as new
pending requests.
2018-12-31 17:07:14 -06:00
evazion 44a54f75cd tests: don't automatically approve aliases/implications on creation.
Automagically approving inactive aliases makes testing more difficult.
2018-12-31 17:07:14 -06:00
evazion 341403c7bb tests: fix broken bulk update request test. 2018-12-31 17:07:14 -06:00
evazion 6a77b68b74 tumblr: fix tests. 2018-12-27 15:03:11 -06:00
evazion 0f513d1a1b twitter: include intent url in new artist entries (#4028). 2018-12-27 15:03:11 -06:00
evazion 2129e60b2b pixiv: include stacc url in new artist entries (#4028). 2018-12-27 15:03:11 -06:00
evazion 2170961f47 artists: improve prefilling of new artist form (#4028)
* When creating an artist by clicking the '?' next to the artist tag in
  the tag list, prefill the new artist form by finding the artist's last
  upload and fetching its source data.

  Previously we filled the urls with the source of the artist's last
  upload, which was wrong because it was usually a direct image URL (#3078).

* Fix the other names field not escaping spaces within names to underscores.

* Fix the other names field being potentially prefilled with duplicate names.
2018-12-27 15:03:11 -06:00
evazion 286bf2f285 artists: filter out duplicates from other names (#4028). 2018-12-27 15:03:11 -06:00
evazion 3c9b26c247 tests: fix *_(cosplay) tagging test (fixup for 51b08d224). 2018-12-26 20:16:59 -06:00
evazion 719f556dd5 aliases: warn about conflicting wikis when alias is requested.
* Warn about conflicting wiki pages during secondary validation.

* Only warn about missing wiki if both tags are missing a wiki page.
2018-12-26 17:30:07 -06:00
evazion 365e04b5f9 implications: fix validation of circular implications.
Fix bug where circular chains like `a -> b && b -> c && c -> a` were
allowed.
2018-12-26 17:30:07 -06:00
evazion 51b08d2243 implications: ensure antecedent/consequent tags exist. 2018-12-26 17:30:07 -06:00
evazion c27ba02b88 aliases/implications: clean up validations.
* Don't return true/false in validations (does nothing).
* Prefer `errors[:base]` over `self.errors[:base]`.
* Add antecedent_wiki / consequent_wiki associations.
* Factor out antecedent_and_consequent_are_different validation.
2018-12-26 17:30:07 -06:00
evazion 3e382bd831 Fix #4014: Incorrect tag type counts on posts. 2018-12-19 12:20:29 -06:00
evazion 8408c0bf80 Fix #3815: Adjust notes positions/sizes after post replacement
Bug: Notes weren't rescaled when the 'final_source' field was given
during replacement.

The cause was that the notes were rescaled after the source was saved,
but saving the source clobbered `image_{width,height}_before_last_save`
inside `rescale_notes`.

Regressed in b0c2ddba.
2018-12-16 13:55:35 -06:00
evazion c700ea4b5f Fix #4016: Translated tags failing to find some tags.
* Normalize spaces to underscores when saving other names. Preserve case
  since case can be significant.

* Fix WikiPage#other_names_include to search case-insensitively (note:
  this prevents using the index).

* Fix sources to return the raw tags in `#tags` and the normalized tags
  in `#normalized_tags`. The normalized tags are the tags that will be
  matched against other names.
2018-12-16 11:37:57 -06:00
Albert Yi 4706cae114 Add user permissions for flagging and for giving user feedback 2018-12-11 17:08:31 -08:00
evazion ea9c3576d8 search: add synonyms for *_count metatags.
Allow e.g. `deleted_comments` as a synonym for `deleted_comment_count`.
2018-12-11 18:10:20 -06:00