it's ok if import script can't lower trust level of an admin user

This commit is contained in:
Neil Lalonde 2015-04-17 11:34:20 -04:00
parent ccce27d1b8
commit e8527c5e3e
1 changed files with 5 additions and 1 deletions

View File

@ -620,7 +620,11 @@ class ImportScripts::Base
progress_count = 0
User.find_each do |user|
begin
user.change_trust_level!(0) if Post.where(user_id: user.id).count == 0
rescue Discourse::InvalidAccess
nil
end
progress_count += 1
print_status(progress_count, total_count)
end