FIX: errors due to confusion between trustLevel and trust_level (#8149)
This commit is contained in:
parent
1e2aa263a9
commit
aaf15944f8
|
@ -243,12 +243,12 @@ const AdminUser = Discourse.User.extend({
|
|||
this.set("originalTrustLevel", this.trust_level);
|
||||
},
|
||||
|
||||
dirty: propertyNotEqual("originalTrustLevel", "trustLevel.id"),
|
||||
dirty: propertyNotEqual("originalTrustLevel", "trust_level"),
|
||||
|
||||
saveTrustLevel() {
|
||||
return ajax(`/admin/users/${this.id}/trust_level`, {
|
||||
type: "PUT",
|
||||
data: { level: this.get("trustLevel.id") }
|
||||
data: { level: this.trust_level }
|
||||
})
|
||||
.then(() => window.location.reload())
|
||||
.catch(e => {
|
||||
|
@ -266,7 +266,7 @@ const AdminUser = Discourse.User.extend({
|
|||
},
|
||||
|
||||
restoreTrustLevel() {
|
||||
this.set("trustLevel.id", this.originalTrustLevel);
|
||||
this.set("trust_level", this.originalTrustLevel);
|
||||
},
|
||||
|
||||
lockTrustLevel(locked) {
|
||||
|
|
|
@ -369,8 +369,9 @@
|
|||
<div class="value">
|
||||
{{combo-box
|
||||
content=site.trustLevels
|
||||
value=model.trustLevel.id
|
||||
nameProperty="detailedName"}}
|
||||
value=model.trust_level
|
||||
nameProperty="detailedName"
|
||||
}}
|
||||
|
||||
{{#if model.dirty}}
|
||||
<div>
|
||||
|
|
Loading…
Reference in New Issue