mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 11:20:57 -06:00
import approval state of users in Ning import script
This commit is contained in:
parent
c7fa4a029d
commit
c3c202f59e
@ -69,13 +69,20 @@ class ImportScripts::Ning < ImportScripts::Base
|
|||||||
if staff_levels.include?(u["level"].downcase)
|
if staff_levels.include?(u["level"].downcase)
|
||||||
if u["level"].downcase == "admin" || u["level"].downcase == "owner"
|
if u["level"].downcase == "admin" || u["level"].downcase == "owner"
|
||||||
newuser.admin = true
|
newuser.admin = true
|
||||||
newuser.save
|
|
||||||
else
|
else
|
||||||
newuser.moderator = true
|
newuser.moderator = true
|
||||||
newuser.save
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# states: ["active", "suspended", "left", "pending"]
|
||||||
|
if u["state"] == "active"
|
||||||
|
newuser.approved = true
|
||||||
|
newuser.approved_by_id = @system_user.id
|
||||||
|
newuser.approved_at = newuser.created_at
|
||||||
|
end
|
||||||
|
|
||||||
|
newuser.save
|
||||||
|
|
||||||
if u["profilePhoto"]
|
if u["profilePhoto"]
|
||||||
photo_path = file_full_path(u["profilePhoto"])
|
photo_path = file_full_path(u["profilePhoto"])
|
||||||
if File.exists?(photo_path)
|
if File.exists?(photo_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user