r888888888
78b08d8394
add new model for post replacements, add undo functionality
2017-05-12 17:11:40 -07:00
Albert Yi
dc02dcf0e0
Merge pull request #3015 from evazion/feat-replace-images
...
Fix #2949 : Sample image replacement ability
2017-05-12 17:11:29 -07:00
evazion
757a7da49b
fixup! /source.json: don't encode '&' as '&' in commentaries.
2017-05-10 21:03:29 -05:00
Albert Yi
b4097dbc8a
Merge pull request #3034 from evazion/fix-comment-order
...
Fix /comments.json returning results in undefined order.
2017-05-10 15:21:52 -07:00
evazion
a3a9a78015
/comments.json: default to id_desc order instead undefined order.
2017-05-09 18:12:37 -05:00
r888888888
ff5586cb01
refactor twitter service to handle cards ( fixes #3031 )
2017-05-09 12:48:11 -07:00
Albert Yi
0018a09f30
Merge pull request #3027 from evazion/feat-flag-cooldown
...
Add 3 day cooldown between flags
2017-05-08 13:05:38 -07:00
evazion
d40da8c5c9
post replacement: leave a system comment after replacement.
2017-05-05 16:10:43 -05:00
evazion
31a38ea39a
flags: add flag cooldown test.
2017-05-04 17:37:59 -05:00
evazion
43ad3258e5
API: fix api limits being lowered when user doesn't have api key.
2017-05-04 12:57:20 -05:00
Albert Yi
b6e1958917
Merge pull request #3017 from evazion/fix-deviantart-links
...
Fix links to DeviantArt sources
2017-05-03 15:49:16 -07:00
evazion
5f2219a005
post replacement: add tests.
2017-05-02 20:42:41 -05:00
evazion
93c9b622a1
post_approval.rb: log correct post id when approving deleted posts.
2017-05-02 00:01:21 -05:00
evazion
1baffb31ff
Link dA sources as http://$artist.deviantart.com/art/$title-$id in sidebar.
...
Previously we used 'http://$artist.deviantart.com/gallery/#/d$id '. This
relied on a javascript redirect on Deviantart's end, which didn't work
for people with javascript disabled.
2017-05-01 23:29:16 -05:00
Albert Yi
d7e83bef79
Merge pull request #3003 from evazion/feat-noter-any-metatag
...
Add noter:<any|none>, commenter:<any|none> metatags
2017-05-01 14:52:30 -07:00
Albert Yi
590bfa18f6
Merge pull request #3005 from evazion/fix-ss-query-normalization
...
Fix #2995 : Saved searches’ tags are getting reordered
2017-05-01 14:51:01 -07:00
r888888888
48e9856f37
fixes #3007 : Eliminate Janitor role
2017-05-01 14:38:30 -07:00
Albert Yi
99ed0cc437
Merge pull request #3008 from evazion/fix-disallow-blank-notes
...
Fix #1566 : disallow blank note bodies.
2017-05-01 14:18:28 -07:00
evazion
e31f8acc34
dmails: add title search test.
2017-04-29 11:50:26 -05:00
evazion
a3ecfdb79d
notes: disallow blank note bodies.
2017-04-28 19:34:27 -05:00
evazion
8e5491a536
saved searches: add query normalization tests.
2017-04-28 16:26:44 -05:00
evazion
25aaef5afe
Add tests for noter:<any|none>, comm:<any|none> metatags.
2017-04-26 16:51:34 -05:00
Albert Yi
641f56dc2a
Merge pull request #3002 from evazion/feat-artist-search
...
Fix #2994 : More options for artist search page
2017-04-26 14:00:25 -07:00
Albert Yi
41b245d19d
Merge pull request #2998 from evazion/fix-quote-stripping
...
Fix [quote] stripping for comments, forum post replies.
2017-04-26 12:43:30 -07:00
evazion
d1188d8184
/artists: add search params: has_tag, name/other_names/group_name/any_name/url_matches.
2017-04-26 14:08:18 -05:00
evazion
54db229094
comment_test.rb: add quote-stripping test.
2017-04-24 21:15:47 -05:00
evazion
8404064854
related_tag_calculator.rb: fix memcache lookup in inner loop.
...
Remove the category constraint option from RelatedTagCalculator.calculate_from_posts.
It slows things down and isn't used.
This method is used to calculate the related tags sidebar during
searches for single metatags. Using Tag.category_for in the inner loop
caused a memcache call on every iteration. At 100 posts per page and
20-30 tags per post, this led to up to 2000-3000 total memcache calls,
which significantly slowed pageloads.
2017-04-23 17:10:20 -05:00
Albert Yi
bd38fb3de1
Merge pull request #2986 from evazion/fix-ss-migrations
...
Fix broken tag subscription migrations.
2017-04-22 01:03:30 -07:00
evazion
0b2493b2dd
tag subscriptions: fix broken saved search migrations.
2017-04-21 22:48:52 -05:00
r888888888
b053a2d783
add source + rewrite strategy for pawoo
2017-04-20 15:50:22 -07:00
evazion
94e548cfe1
/bans: add test for searching bans.
2017-04-19 17:56:26 -05:00
r888888888
113d8824d5
fix bur test
2017-04-19 14:04:36 -07:00
r888888888
68f057e7ba
refactor how artist notes are updated
2017-04-18 17:07:12 -07:00
Albert Yi
42f6e8dc48
Merge pull request #2976 from evazion/fix-tests
...
Fix failing Pixiv tests
2017-04-17 13:09:32 -07:00
evazion
c0e5c400a7
tests: fix tests for Rails.cache.
2017-04-16 16:48:36 -05:00
evazion
b68cb174f5
tests: fix pixiv tests to use https://i.pixiv.net .
2017-04-15 23:14:41 -05:00
r888888888
621bef3ddf
Revert "Merge pull request #2952 from evazion/fix-2950"
...
This reverts commit ae4509a541197684bfb0538f65afa827854b4335, reversing
changes made to eb008a0e765e231a8fdef594759a61798d6bd1d5.
2017-04-14 12:28:58 -07:00
evazion
9b53d32b4c
post_archive_test.rb: exercise pool metatag not saving bug ( #2972 ).
2017-04-14 13:49:54 -05:00
r888888888
19b8d41d09
refactor forum notifications for tag changes
2017-04-12 16:43:15 -07:00
r888888888
0b8d4105aa
fix tests
2017-04-04 12:39:17 -07:00
evazion
777937591e
Post#give_favorites_to_parent: move hidden favs.
2017-04-03 22:36:20 -05:00
evazion
5db39f308a
tests: fix post approval tests.
2017-04-03 17:18:32 -05:00
evazion
7c8135609b
post_approval_test.rb: tabs to spaces.
2017-04-03 17:18:32 -05:00
evazion
e6328b8d30
post_approval_test.rb: move to test/unit.
2017-04-03 17:18:32 -05:00
evazion
3c89ee3199
tests: add more post/pool version creation tests.
...
Adds the `test_after_commit` gem too because after_commit callbacks
don't fire inside tests in rails <5.0.
2017-04-03 15:03:59 -07:00
evazion
25b2b399cc
saved searches: fix exception when searching for search:adfijoioi.
...
Fixes this exception:
NoMethodError exception raised
undefined method `empty?' for nil:NilClass
app/logical/post_query_builder.rb:113:in `block in add_saved_search_relation'
app/logical/post_query_builder.rb:106:in `each'
app/logical/post_query_builder.rb:106:in `add_saved_search_relation'
app/logical/post_query_builder.rb:237:in `build'
app/models/post.rb:1624:in `tag_match'
app/models/post.rb:1172:in `block in fast_count_search'
config/initializers/active_record_extensions.rb:16:in `with_timeout'
app/models/post.rb:1171:in `fast_count_search'
app/models/post.rb:1162:in `fast_count'
app/logical/post_sets/post.rb:106:in `get_post_count'
app/logical/post_sets/post.rb:122:in `posts'
app/controllers/posts_controller.rb:15:in `index'
caused by this failure in listbooru when you send it an empty array as the list of queries:
Redis::CommandError - ERR wrong number of arguments for 'zunionstore' command:
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis/client.rb:121:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis.rb:1932:in `block in zunionstore'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis.rb:58:in `block in synchronize'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis.rb:58:in `synchronize'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis.rb:1931:in `zunionstore'
web/listbooru.rb:85:in `aggregate_searches'
web/listbooru.rb:104:in `block in <main>'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `block incompile!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in `route_eval'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in `block inprocess_route'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `catch'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `process_route'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in `block in route!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `each'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `route!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in `block indispatch!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block ininvoke'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in `dispatch!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `block in call!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block ininvoke'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `call!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:895:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-1.6.5/lib/rack/logger.rb:15:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-1.6.5/lib/rack/commonlogger.rb:33:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:219:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:212:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-1.6.5/lib/rack/head.rb:13:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-1.6.5/lib/rack/methodoverride.rb:22:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/show_exceptions.rb:25:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `block incall'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1787:in `synchronize'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-1.6.5/lib/rack/handler/webrick.rb:88:in `service'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'
2017-04-03 15:03:26 -07:00
evazion
163d338874
post_vote_test.rb: add more voting tests.
2017-03-24 15:43:55 -05:00
evazion
4470828a3d
post_test.rb: add tests for moving favorites.
2017-03-24 15:43:55 -05:00
evazion
a5ecda2f0e
post_test.rb: fix voting tests.
2017-03-24 15:43:55 -05:00
evazion
3dc854c0c8
post_vote.rb: determine vote magnitude from voter, not CurrentUser.
...
Bug: when moving favorites, the parent is given an upvote for each gold+
favoriter, but the magnitude of these upvotes was based on the
CurrentUser, rather than the upvoter. This meant that upvotes for
supervoter favorites weren't given correctly.
To fix this, `magnitude` is changed to use the voting `user` instead of
CurrentUser.
New problem: when setting the score, `score=` calls `magnitude`, but
`user` isn't initialized yet. So we also refactor so that
1. `initialize_attributes` initializes `user` before setting `score`
2. the vote direction is given by `vote`, so it's separate from `score`
3. updating the score on the post happens in a callback instead of
directly in `score=`.
2017-03-24 15:43:55 -05:00