mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-15 01:11:23 +00:00
fixed error for old bans that don't have a creator
validation failed on editing older bans that do not have a creator. Added a check to make sure this is still working.
This commit is contained in:
parent
a3a7e92789
commit
035f15648a
1 changed files with 1 additions and 1 deletions
|
@ -71,7 +71,7 @@ class Ban < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_permission
|
def validate_permission
|
||||||
unless creator.admin? or (creator.gather_moderator? and self.ban_type == TYPE_GATHER)
|
unless creator and (creator.admin? or (creator.gather_moderator? and self.ban_type == TYPE_GATHER))
|
||||||
errors.add :ban_type, 'Gather Moderators can only create gather bans'
|
errors.add :ban_type, 'Gather Moderators can only create gather bans'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue