v0.60 Final tweak for topic and user count updating for last public posts

This commit is contained in:
David Sainty 2024-09-02 18:02:17 +10:00
parent 8814b3f76c
commit d52db70f96

View File

@ -1938,9 +1938,9 @@ class GossamerForumsImporter < ImportScripts::Base
## user_stat.update_columns(post_count: new_post_count) ## user_stat.update_columns(post_count: new_post_count)
# Fetch the current user and check if Trust Level needs updating # Fetch the current user and check if Trust Level needs updating
new_trust_level = case post_count # new_trust_level = case post_count
when 0..29 then 1 # basic user # when 0..29 then 1 # basic user
else 2 # member, regular reserved for now. # else 2 # member, regular reserved for now.
# when 3..50 then 2 # member # when 3..50 then 2 # member
# else 3 # regular or above when 51..100 # else 3 # regular or above when 51..100
end end
@ -1948,9 +1948,16 @@ class GossamerForumsImporter < ImportScripts::Base
user = User.find(user_id) user = User.find(user_id)
current_trust_level = user.trust_level current_trust_level = user.trust_level
if user.id == 2 if user.id == 101978
puts "USER ID 2, so TRUST LEVEL 4" puts "USER ID 101978, so TRUST LEVEL 4"
new_trust_level = 4 new_trust_level = 4
elsif user.id == 2
puts "USER ID 2, so TRUST LEVEL 2"
new_trust_level = 2
elsif [111533, 161794, 163535, 172916, 177877, 183157, 189831, 191083, 192666, 195599, 198625, 200072, 200823, 201878, 201968].include?(user.id)
new_trust_level = 1
else
new_trust_level = 2
end end
# Only update trust level if the new level is higher than the current one # Only update trust level if the new level is higher than the current one