Don't validate the revoker for a block if it hasn't changed
The revoker only has to be a moderator at the time they make the revocation - as things stood trying to view a block that had been revoked by somebody that was no longer a moderator failed.
This commit is contained in:
parent
928465764e
commit
b1e1572af3
1 changed files with 1 additions and 1 deletions
|
@ -79,6 +79,6 @@ class UserBlock < ApplicationRecord
|
|||
# but i've also included it here just in case.
|
||||
def moderator_permissions
|
||||
errors.add(:base, I18n.t("user_block.model.non_moderator_update")) if creator_id_changed? && !creator.moderator?
|
||||
errors.add(:base, I18n.t("user_block.model.non_moderator_revoke")) unless revoker_id.nil? || revoker.moderator?
|
||||
errors.add(:base, I18n.t("user_block.model.non_moderator_revoke")) if revoker_id_changed? && !revoker_id.nil? && !revoker.moderator?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue