Add validation of media attachments, clean up mastodon-own exception classes

This commit is contained in:
Eugen Rochko 2017-02-26 23:23:06 +01:00
parent 063432d7e3
commit 5f511324b6
8 changed files with 22 additions and 22 deletions

View file

@ -10,7 +10,7 @@ class FollowService < BaseService
target_account = FollowRemoteAccountService.new.call(uri)
raise ActiveRecord::RecordNotFound if target_account.nil? || target_account.id == source_account.id || target_account.suspended?
raise Mastodon::NotPermitted if target_account.blocking?(source_account) || source_account.blocking?(target_account)
raise Mastodon::NotPermittedError if target_account.blocking?(source_account) || source_account.blocking?(target_account)
if target_account.locked?
request_follow(source_account, target_account)