FIX: Editing a category definition topic was clearing its permissions

This commit is contained in:
Robin Ward 2014-12-02 11:46:21 -05:00
parent 1210486623
commit 87667cfe17

View File

@ -66,7 +66,12 @@ Discourse.Site = Discourse.Model.extend({
updateCategory: function(newCategory) {
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);
}
}
});