mirror of
https://github.com/discourse/discourse.git
synced 2025-02-01 00:07:38 +08:00
FIX: Editing a category definition topic was clearing its permissions
This commit is contained in:
parent
1210486623
commit
87667cfe17
|
@ -66,7 +66,12 @@ Discourse.Site = Discourse.Model.extend({
|
||||||
|
|
||||||
updateCategory: function(newCategory) {
|
updateCategory: function(newCategory) {
|
||||||
var existingCategory = this.get('categories').findProperty('id', Em.get(newCategory, 'id'));
|
var existingCategory = this.get('categories').findProperty('id', Em.get(newCategory, 'id'));
|
||||||
if (existingCategory) existingCategory.setProperties(newCategory);
|
if (existingCategory) {
|
||||||
|
// Don't update null permissions
|
||||||
|
if (newCategory.permission === null) { delete newCategory.permission; }
|
||||||
|
|
||||||
|
existingCategory.setProperties(newCategory);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user