FIX: errors due to confusion between trustLevel and trust_level (#8149)

This commit is contained in:
Joffrey JAFFEUX 2019-10-03 08:52:07 -04:00 committed by GitHub
parent 1e2aa263a9
commit aaf15944f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -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) {

View File

@ -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>