fixed logical flaw in last commit

This commit is contained in:
Absurdon 2017-03-08 02:21:49 +01:00
parent 4ce05f2563
commit 839aae732a

View file

@ -71,7 +71,7 @@ class Ban < ActiveRecord::Base
end
def validate_permission
unless creator and (creator.admin? or (creator.gather_moderator? and self.ban_type == TYPE_GATHER))
unless creator.nil? or creator.admin? or (creator.gather_moderator? and self.ban_type == TYPE_GATHER)
errors.add :ban_type, 'Gather Moderators can only create gather bans'
end
end