Disallow adding blocked users to lists
This commit is contained in:
parent
b38ae50ba7
commit
56799f60c7
|
@ -95,6 +95,9 @@ class Ajax::ListController < AjaxController
|
||||||
|
|
||||||
target_user = User.find_by_screen_name!(params[:user])
|
target_user = User.find_by_screen_name!(params[:user])
|
||||||
|
|
||||||
|
raise Errors::ListingSelfBlockedOther if current_user.blocking?(target_user)
|
||||||
|
raise Errors::ListingOtherBlockedSelf if target_user.blocking?(current_user)
|
||||||
|
|
||||||
if add
|
if add
|
||||||
list.add_member target_user if list.members.find_by_user_id(target_user.id).nil?
|
list.add_member target_user if list.members.find_by_user_id(target_user.id).nil?
|
||||||
@response[:checked] = true
|
@response[:checked] = true
|
||||||
|
|
|
@ -85,5 +85,11 @@ module Errors
|
||||||
|
|
||||||
class ReactingOtherBlockedSelf < OtherBlockedSelf
|
class ReactingOtherBlockedSelf < OtherBlockedSelf
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class ListingSelfBlockedOther < SelfBlockedOther
|
||||||
|
end
|
||||||
|
|
||||||
|
class ListingOtherBlockedSelf < OtherBlockedSelf
|
||||||
|
end
|
||||||
# endregion
|
# endregion
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue