Commit Graph

262 Commits

Author SHA1 Message Date
Albert Yi
fdd7582fb0 add support for upload preprocessing 2018-06-14 17:52:41 -07:00
Albert Yi
6c14d19010 fix tests 2018-06-05 16:08:45 -07:00
Albert Yi
856637ace4 fix tests 2018-06-05 15:51:06 -07:00
Albert Yi
63ab637419 potential fix for #3727 2018-05-25 10:16:52 -07:00
Albert Yi
308cfc2376 reduce constraints for when to show forum post vote links (#3691) 2018-05-15 11:20:16 -07:00
Albert Yi
32ad389581 Merge branch 'circleci-fixes' 2018-05-15 10:34:26 -07:00
Albert Yi
8b16934aaa skip pixiv-related tests that throw networking errors 2018-05-15 10:19:20 -07:00
Albert Yi
8d5db3723b skip tests that throw an net::opentimeout error 2018-05-14 10:45:46 -07:00
Albert Yi
9310b39fda hide forum votes if the request is not pending 2018-05-11 17:05:26 -07:00
Albert Yi
7dbeffbfa2 fix test 2018-05-10 15:09:04 -07:00
Albert Yi
76eeafca2c fix for tests 2018-05-10 11:24:17 -07:00
Albert Yi
72f319ccf3 rename lambda references to use shorthand syntax 2018-05-10 11:18:02 -07:00
Albert Yi
320f1a426e fixes #3704 2018-05-10 10:20:51 -07:00
Albert Yi
99012ff342 fix tests 2018-05-09 11:59:51 -07:00
evazion
bfecbffb97 post approvals: add to post events page. 2018-05-05 14:00:58 -05:00
evazion
7c1d5e25fb post approvals: add index page + search options (fix #3579). 2018-05-05 14:00:49 -05:00
evazion
e6ce05eb29 uploads: add more search options for /uploads listing (#3657). 2018-04-20 15:51:56 -05:00
evazion
8083c7daae uploads: fix batch upload page to work without bookmarklet.
* Add a form to the /uploads/batch page so that it can be used without
  the bookmarklet.

* Fix an exception when no url is given.
2018-04-20 15:51:56 -05:00
evazion
bca483cefd Fix #3628: Retry button is displayed for failed uploads that cannot succeed even if retried 2018-04-12 22:14:06 -05:00
r888888888
abce4d2551 Raise error on unpermitted params.
Fail loudly if we forget to whitelist a param instead of silently
ignoring it.

misc models: convert to strong params.

artist commentaries: convert to strong params.

* Disallow changing or setting post_id to a nonexistent post.

artists: convert to strong params.

* Disallow setting `is_banned` in create/update actions. Changing it
  this way instead of with the ban/unban actions would leave the artist in
  a partially banned state.

bans: convert to strong params.

* Disallow changing the user_id after the ban has been created.

comments: convert to strong params.

favorite groups: convert to strong params.

news updates: convert to strong params.

post appeals: convert to strong params.

post flags: convert to strong params.

* Disallow users from setting the `is_deleted` / `is_resolved` flags.

ip bans: convert to strong params.

user feedbacks: convert to strong params.

* Disallow users from setting `disable_dmail_notification` when creating feedbacks.
* Disallow changing the user_id after the feedback has been created.

notes: convert to strong params.

wiki pages: convert to strong params.

* Also fix non-Builders being able to delete wiki pages.

saved searches: convert to strong params.

pools: convert to strong params.

* Disallow setting `post_count` or `is_deleted` in create/update actions.

janitor trials: convert to strong params.

post disapprovals: convert to strong params.

* Factor out quick-mod bar to shared partial.
* Fix quick-mod bar to use `Post#is_approvable?` to determine visibility
  of Approve button.

dmail filters: convert to strong params.

password resets: convert to strong params.

user name change requests: convert to strong params.

posts: convert to strong params.

users: convert to strong params.

* Disallow setting password_hash, last_logged_in_at, last_forum_read_at,
  has_mail, and dmail_filter_attributes[user_id].

* Remove initialize_default_image_size (dead code).

uploads: convert to strong params.

* Remove `initialize_status` because status already defaults to pending
  in the database.

tag aliases/implications: convert to strong params.

tags: convert to strong params.

forum posts: convert to strong params.

* Disallow changing the topic_id after creating the post.
* Disallow setting is_deleted (destroy/undelete actions should be used instead).
* Remove is_sticky / is_locked (nonexistent attributes).

forum topics: convert to strong params.

* merges https://github.com/evazion/danbooru/tree/wip-rails-5.1
* lock pg gem to 0.21 (1.0.0 is incompatible with rails 5.1.4)
* switch to factorybot and change all references

Co-authored-by: r888888888 <r888888888@gmail.com>
Co-authored-by: evazion <noizave@gmail.com>

add diffs
2018-04-06 18:09:57 -07:00
evazion
d089be9f8a tests: fix upload tests. 2018-03-20 19:49:58 -05:00
evazion
84a0a89f4b Fix #3539: Open redirect vulnerabilities. 2018-02-07 19:52:52 -06:00
evazion
c29785268d tests: fix iqdb controller test (#3479). 2018-01-20 13:22:05 -06:00
evazion
ce06736374 tests: fix timestamp comparison in artist notes saving test.
Equality test failed due to microsecond level differences. Truncate to
seconds to avoid this.
2018-01-20 13:08:40 -06:00
evazion
4f543671a2 tests: move test/helpers to test/test_helpers.
The Rails convention is for test/helpers to be used for testing the view
helpers in app/helpers. We were using it to store certain utility
methods instead. Move these to test/test_helpers so that test/helpers
can be used for its intended purpose.
2018-01-14 16:11:15 -06:00
r888888888
4a80d6c337 refactor User#validate_sock_puppet to disable for tests 2018-01-02 14:32:38 -08:00
evazion
32ac09ee48 Add test for registering sock puppet accounts. 2017-12-27 13:33:57 -06:00
evazion
91592b2f18 Fix #3448: Lower the limit for tag category changes.
Also allow admins to bypass all restrictions.
2017-12-23 13:44:45 -06:00
evazion
fa941e9480 /post_replacements: allow updating image metadata in past replacements. 2017-12-18 18:03:03 -06:00
evazion
8d8a2f9c1e Make recaptcha optional on signup page. 2017-11-29 18:09:37 -06:00
r888888888
ba517af1db fix functional tests 2017-11-20 16:30:07 -08:00
r888888888
e70c2a3085 remove references to tag subscriptions 2017-11-17 13:45:17 -08:00
evazion
f633222ef0 twitter: test fetching source data from direct image with referer. 2017-11-16 13:29:58 -06:00
r888888888
014b9af5f8 fetch ugoiras for batch action #3317 2017-10-03 13:36:56 -07:00
evazion
3e3844a796 Remove unused tag subscription code (#2956, #3206). 2017-07-13 13:44:26 -05:00
evazion
ef1db967f7 /dmails: allow banned users to read/delete dmails. 2017-07-06 18:39:42 -05:00
evazion
cda1ee3d88 /users: allow banned users to edit account settings.
The member_only check prevents banned users from editing their account
settings. This isn't needed since check_privilege handles the privilege check.
2017-07-06 18:39:42 -05:00
evazion
cc54c16fac /artists/show_or_new: make public; add "artist doesn't exist" page.
* Fix access denied error when anonymous users open /artists/show_or_new.

* When the artist doesn't exist, take user to "artist doesn't exist"
  page instead of redirecting to /artists/new.
2017-07-06 18:37:13 -05:00
evazion
5a2745ee71 Fix post replacement controller test.
Broken in 27aa9fe. Delayed jobs have to be enabled when creating a
replacement, otherwise replacement will try to immediately delete the
existing files, which fails because they're still in use.
2017-07-01 13:37:32 -05:00
evazion
1d62ea3220 /forum_topics: don't list stickies first in json/atom responses. 2017-06-04 16:14:55 -05:00
Albert Yi
2f1faf3c38 Merge pull request #3060 from evazion/fix-3048
Fix #3048: Artist Lookup Failing Due to Changing Usernames
2017-05-15 16:33:53 -07:00
Albert Yi
6ddf0821d8 Merge pull request #3055 from evazion/feat-post-replacement-controller
Add post replacements controller.
2017-05-15 16:19:34 -07:00
Albert Yi
79484586cd Merge branch 'master' into fix-forum-topic-visits 2017-05-15 16:10:21 -07:00
evazion
eac827973b Normalize pixiv artist urls to pixiv member page (fix #3048). 2017-05-15 14:12:08 -05:00
evazion
9b73823ccd Add post replacement create action test. 2017-05-14 21:31:12 -05:00
evazion
cb09b6661d Add /post_replacements.json, /posts/1234/replacements.json. 2017-05-14 18:49:57 -05:00
evazion
71a19c28f1 forum topics: don't record a topic visit for api requests. 2017-05-13 13:50:20 -05:00
evazion
8c88e87710 /forum_topics.atom: add atom feed for forum topics. 2017-05-13 10:37:59 -05:00
evazion
e68946e95d /comments.atom: add atom feed for comments. 2017-05-13 10:37:58 -05:00
Albert Yi
b4051526ff Merge pull request #3025 from evazion/fix-xml-attrs
Fix #3024: strip '?' from API attributes
2017-05-08 12:59:57 -07:00