Lock trust level doesn't seem to work

What I’m finding is that when I lock the trust level of a TL 0 user, the Lock Trust Level button doesn’t update to display the Unlock Trust Level button. When I lock the trust level of a TL 1 user, the Lock Trust Level button is correctly updated to display Unlock Trust Level.

After locking the trust level of a TL 0 user, the user’s trust level seems to be locked at Trust Level 0, even though the UI doesn’t reflect this. Have you found users whose trust level you have locked at 0 being promoted to Trust Level 1?

In the database, when a TL 0 user has their trust level locked the user’s manual_locked_trust_level property is set to 0 (their trust level.)

The problem could be that for a TL 0 user model.manual_locked_trust_level returns 0, so the Unlock Trust Level button can’t be displayed.

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/admin/templates/user-index.hbs#L307

5 Likes