mirror of
https://github.com/discourse/discourse.git
synced 2025-08-20 18:52:44 +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:
parent
8a2995f719
commit
71be74ffd3
5 changed files with 38 additions and 18 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue