do not limit flags for system user

This commit is contained in:
r888888888
2017-03-17 12:15:36 -07:00
parent ecdea34323
commit c3c4952e35

View File

@@ -97,6 +97,8 @@ class PostFlag < ActiveRecord::Base
def validate_creator_is_not_limited
if CurrentUser.can_approve_posts?
# do nothing
elsif User.system.present? && CurrentUser.id == User.system.id
# do nothing
elsif creator.created_at > 1.week.ago
errors[:creator] << "cannot flag within the first week of sign up"
elsif creator.is_gold? && flag_count_for_creator >= 10