mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
it's ok if import script can't lower trust level of an admin user
This commit is contained in:
@@ -620,7 +620,11 @@ class ImportScripts::Base
|
||||
progress_count = 0
|
||||
|
||||
User.find_each do |user|
|
||||
user.change_trust_level!(0) if Post.where(user_id: user.id).count == 0
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user