# Lock trust level doesn't seem to work

**URL:** https://meta.discourse.org/t/lock-trust-level-doesnt-seem-to-work/90201
**Category:** Bug
**Created:** [June 19, 2018, 11:28am UTC](https://meta.discourse.org/t/lock-trust-level-doesnt-seem-to-work/90201 "2018-06-19T11:28:40Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [June 19, 2018, 11:28am UTC](https://meta.discourse.org/t/lock-trust-level-doesnt-seem-to-work/90201/1 "2018-06-19T11:28:40Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/1/4/147e5bc46a909b6224528048dcb456961ae65040.png)

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

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

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [June 19, 2018, 11:45am UTC](https://meta.discourse.org/t/lock-trust-level-doesnt-seem-to-work/90201/2 "2018-06-19T11:45:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [June 19, 2018, 7:44pm UTC](https://meta.discourse.org/t/lock-trust-level-doesnt-seem-to-work/90201/3 "2018-06-19T19:44:36Z")

</div>

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](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/admin/templates/user-index.hbs#L307)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 19, 2018, 11:04pm UTC](https://meta.discourse.org/t/lock-trust-level-doesnt-seem-to-work/90201/4 "2018-06-19T23:04:05Z")

</div>

I noticed this too; we should fix this.

---

<div class="post-metadata">

### Author: ![featheredtoast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/featheredtoast/32/116994_2.png) [@featheredtoast](https://meta.discourse.org/u/featheredtoast)
#### Post date: [June 19, 2018, 11:51pm UTC](https://meta.discourse.org/t/lock-trust-level-doesnt-seem-to-work/90201/5 "2018-06-19T23:51:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![featheredtoast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/featheredtoast/32/116994_2.png) [@featheredtoast](https://meta.discourse.org/u/featheredtoast)
#### Post date: [June 20, 2018, 12:51am UTC](https://meta.discourse.org/t/lock-trust-level-doesnt-seem-to-work/90201/7 "2018-06-20T00:51:12Z")

</div>

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

[https://github.com/discourse/discourse/commit/406c6d679a11d1ef04a2426931459ebf5cb8278a](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.

---

<div class="post-metadata">

### Author: ![featheredtoast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/featheredtoast/32/116994_2.png) [@featheredtoast](https://meta.discourse.org/u/featheredtoast)
#### Post date: [June 20, 2018, 12:51am UTC](https://meta.discourse.org/t/lock-trust-level-doesnt-seem-to-work/90201/8 "2018-06-20T00:51:26Z")

</div>


