mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FIX: recalculating trust levels was not working (#20492)
The recalculate code was never firing cause TrustLevel.calculate unconditionally returned a trust level. (albeit a wrong one) New code ensures we only bypass promotion checks for cases where trust level is locked. see: https://meta.discourse.org/t/user-trust-level-resets-to-zero-when-unlocked/255444
This commit is contained in:
@ -38,7 +38,7 @@ class TrustLevel
|
||||
granted_trust_level = user.group_granted_trust_level || 0
|
||||
previous_trust_level = use_previous_trust_level ? find_previous_trust_level(user) : 0
|
||||
|
||||
[granted_trust_level, previous_trust_level].max
|
||||
[granted_trust_level, previous_trust_level, SiteSetting.default_trust_level].max
|
||||
end
|
||||
|
||||
private
|
||||
|
Reference in New Issue
Block a user