Lock trust level doesn't seem to work

though I get the report in the admin logs as an admin action.

p.s.: there is no error in the log.

1 Like

can confirm this, Lock trust level isn’t working!

1 Like

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

I noticed this too; we should fix this.

Thanks for the sleuthing - I can have a look at this, shouldn’t be too bad.

4 Likes

This is now fixed - locked TL0 users display correctly now. Thanks for reporting this! :watermelon:

https://github.com/discourse/discourse/commit/406c6d679a11d1ef04a2426931459ebf5cb8278a

Javascript’s false values still make me want to glue pennies to my eyes every time I deal with them.

10 Likes