Commit Graph

2005 Commits

Author SHA1 Message Date
evazion
49f5a1060e aliases/implications: factor out shared code. 2017-07-29 17:13:34 -05:00
evazion
1000f8d2e2 Fix #3246: Require nonblank body for wiki pages. 2017-07-29 14:59:42 -05:00
evazion
624444d51d artists: validate that urls are well-formed (fix #2346). 2017-07-29 01:44:05 -05:00
evazion
10614d2152 artists: show success/error message when updating artists. 2017-07-29 01:44:05 -05:00
evazion
6121b8cb25 artists: simplify artist url saving code.
Refactor the way artist urls are saved so that artist url validations
run before the artist is saved, not after.
2017-07-29 01:41:37 -05:00
evazion
4b635628cc Fix #3243: Don't create new note versions when nothing is changed. 2017-07-28 17:41:05 -05:00
evazion
76b4b365ae post replacements: don't queue deletion when file is unchanged (#3235).
When replacing a post with the same file, don't queue a deletion and
don't leave a comment or modaction. There's no need to do these things
when we're restoring a missing or corrupted image with the original file.
2017-07-27 16:26:35 -05:00
Albert Yi
9d4697d5cc Merge pull request #3240 from evazion/fix-3235
Fix #3235: Replacements deleting files currently in use.
2017-07-26 17:10:44 -07:00
evazion
b53371b698 Fix #3235: Replacements deleting files currently in use. 2017-07-24 23:43:38 -05:00
evazion
11ef460db0 post replacements: allow replacing post with identical file. 2017-07-24 23:05:34 -05:00
evazion
67528ce5ab Fix hidden attribute leaks in legacy post controller (#3237). 2017-07-24 20:35:12 -05:00
evazion
bda285d97f Post#expunge!: simplify has_children flag logic. 2017-07-21 00:13:20 -05:00
evazion
44f6673d94 Post#expunge!: run callbacks when reparenting children.
* Set parent IDs with `update` instead of `update_column` /
  `update_all` when reparenting children. This fixes it so that new post
  versions are saved and the has_children flag is set on the new parent.

* Slightly simplify logic of update_children_on_destroy: the single
  child case is subsumed by the multi-child case.
2017-07-21 00:13:20 -05:00
evazion
fbee7f6912 Post#expunge!: fix remove_pool! to remove posts from deleted pools.
Don't silently ignore attempts to remove posts from deleted pools.
Remove the restriction on removing posts from deleted pools instead (ref: #1109).

Fixes failure to remove posts from deleted pools during expungement.
2017-07-21 00:13:20 -05:00
evazion
1b310dcc0b Post#expunge!: fix remove_from_all_pools to clear deleted pools.
* Change Post#pools to return all pools, including deleted pools. This
  fixes remove_all_from_pools to remove the post from deleted pools too.

* Change other users of Post#pools to explicitly select undeleted pools.
2017-07-21 00:13:20 -05:00
evazion
bac8ff4de0 Post#expunge!: destroy post replacements on expunge. 2017-07-21 00:13:20 -05:00
evazion
3ed14ae782 Post#expunge!: wrap in transaction. 2017-07-21 00:13:20 -05:00
r888888888
d48ed95191 favoritescontroller#destroy should work even if the post doesn't exist, remove from favorites on expunge (fixes #3222) 2017-07-19 13:39:24 -07:00
r888888888
3a0a032908 remove destroy callback on Post#favorites 2017-07-18 16:32:28 -07:00
evazion
099ae86cc6 Remove duplicate WikiPageVersion#visible? method.
Already defined by `delegate :visible?, :to => :wiki_page`.
2017-07-14 18:43:52 -05:00
evazion
695804fdda Remove duplicate FavoriteGroup#strip_name method.
This method was defined twice.
2017-07-14 18:39:48 -05:00
evazion
4ead45a787 Remove Post#validate_parent_does_not_have_a_parent method (#3206).
Not used; posts are allowed to have grandparents.
2017-07-14 17:49:12 -05:00
evazion
3e3844a796 Remove unused tag subscription code (#2956, #3206). 2017-07-13 13:44:26 -05:00
r888888888
97ce9cafac add httparty option config 2017-07-12 15:52:48 -07:00
r888888888
eb6c5e3af5 switch to httparty 2017-07-12 15:52:48 -07:00
evazion
dc079d7932 /saved_searches/labels.json: support wildcards in search[label] param. 2017-07-11 19:21:41 -05:00
Albert Yi
ca7e841735 Merge pull request #3211 from evazion/fix-remove-key-value
Remove unused KeyValue model (#3206).
2017-07-10 16:55:54 -07:00
Albert Yi
d61d432005 Merge pull request #3210 from evazion/fix-translated-tags
Fix #3208: Fix translated tag suggestions for Pixiv.
2017-07-10 16:54:04 -07:00
evazion
76c90cc0e4 Remove unused Pool methods: create_anonymous/options/id_to_name (#3206)
* Pool.id_to_name: never used.
* Pool.create_anonymous: never used.
* Pool.options: unused since e7aff87.
2017-07-09 14:32:17 -05:00
evazion
f3b0a0a9e9 Remove unused KeyValue model (#3206). 2017-07-09 14:30:44 -05:00
evazion
af35c82d96 Remove unused Artist#legacy_api_hash method (#3206).
Added in 0e0d83c7 but never used. app/views/legacy/artists.{json,xml}.erb
is what *would* use this, but neither does.
2017-07-09 13:49:20 -05:00
evazion
cc8986641b Fix #3208: Fix translated tag suggestions for Pixiv.
* Only suggest the Danbooru tag with the same name if there is no
  matching wiki other name. Example: if we have the Pixiv tag `Fate` and
  the Danbooru tag `fate_(series)` with other name `fate`, suggest that,
  not the Danbooru tag `fate`.

* Don't suggest tags that are empty or whose wiki is deleted.

* Only split tags on "/" if there are no other matches, and only for Pixiv.

* For Pixiv, only include traditional media tags in tag list, not digital media (Photoshop, SAI).

* Add some tests.
2017-07-09 12:10:30 -05:00
evazion
aac1463fbf implications: count 'queued' implications as active.
Bug: implications that were approved but that were still in the 'queued'
state were not seen as active yet, which led to the transitivity
validation passing because it didn't include queued implications.
2017-07-05 00:22:27 -05:00
evazion
542c673221 Fix #3200: Disallow creation of superfluous implications.
Disallow transitive implications. If a -> b -> c already exists, don't
allow a -> c.

Caveat: if b -> c already exists, and we make a BUR for a -> b and a -> c,
the BUR validates even though a -> c is redundant. It only fails
when the BUR is approved.
2017-07-05 00:22:16 -05:00
evazion
c3ac4f3329 Fix #3197 - Post Replacement comment: use Replacement URL instead of Final Source
Record the URL of the image that was actually downloaded as the replacement URL.
2017-07-02 21:00:26 -05:00
evazion
0390039621 Fix expunging posts from S3 (fixup 4c4ef5c / #3180). 2017-07-01 12:30:59 -05:00
r888888888
d4c89bccfc potential fix for #3189 2017-06-29 13:09:33 -07:00
r888888888
d2c8e9ec6a add without timeout block for supervoter calculation 2017-06-27 18:06:57 -07:00
r888888888
4c4ef5cc5b fixes #3180 2017-06-27 15:12:12 -07:00
Albert Yi
c5e3973d6a Merge pull request #3192 from evazion/feat-replacement-remove-tags
Post replacements: streamline removing tags; fix replacement url.
2017-06-27 13:41:50 -07:00
evazion
9c50b24306 post replacements: add "Tags" field to dialog box.
* Adds a "Tags" field to the post replacement dialog box. The given tags
  are added to the post after replacement.

* Prefills the Tags field with certain tags that usually need to be
  removed after replacement: replaceme, image_sample, jpeg_artifacts, etc.
2017-06-26 18:17:16 -05:00
evazion
8d22ab9de8 post replacements: record upload source/filename in replacement_url.
* Record "file://#{filename}" as the replacement url when the
  replacement comes from an uploaded file.

* Record the actual url downloaded by the upload process otherwise. This
  may be different from the url given by the user, since the upload
  process may rewrite the url.
2017-06-26 14:18:57 -05:00
evazion
1889864049 /artist_commentary_versions: show post thumbnails.
Show thumbnails in the /artist_commentary_versions listing. Don't show
thumbnails when viewing the version history of a single post.
2017-06-25 10:27:43 -05:00
evazion
6329d089ee post replacements: add tag match field to search form. 2017-06-22 17:03:05 -05:00
evazion
13d49467a2 post replacements: fix search[creator_name]=... param. 2017-06-22 16:53:20 -05:00
evazion
d3e8937716 post replacements: allow replacing with an uploaded file. 2017-06-22 16:52:55 -05:00
evazion
c27668d2ef post replacements: add option to fix source after replacement.
Adds a "Final Source" field to the post replacement dialog. If
specified, the post's source field will be changed to this value after
replacement.

This makes fixing the source back to the HTML page after
replacement easier.
2017-06-22 16:51:55 -05:00
evazion
dc36476d50 nijie: don't return bogus artists when artist finder finds no match. 2017-06-20 17:09:57 -05:00
evazion
3560bbbd47 pawoo: don't return bogus artists when artist finder doesn't find a match. 2017-06-19 17:10:02 -05:00
Type-kun
faa2d99160 Fix #3174 2017-06-19 18:22:58 +05:00