Skip to content

A platform for community discussion. Free, open, simple.

FIX: check can_create_tag on create and not on select

Joffrey JAFFEUX23ef5f10e98a
diff --git a/app/assets/javascripts/select-kit/components/mini-tag-chooser.js.es6 b/app/assets/javascripts/select-kit/components/mini-tag-chooser.js.es6
index 9f12c5c58f9..f623043370d 100644
--- a/app/assets/javascripts/select-kit/components/mini-tag-chooser.js.es6
+++ b/app/assets/javascripts/select-kit/components/mini-tag-chooser.js.es6
@@ -63,7 +63,7 @@ export default ComboBox.extend({
},
validateCreate(term) {
- if (this.get("limitReached")) {
+ if (this.get("limitReached") || !this.site.get("can_create_tag")) {
return false;
}
@@ -82,8 +82,7 @@ export default ComboBox.extend({
},
validateSelect() {
- return this.get("computedTags").length < this.get("siteSettings.max_tags_per_topic") &&
- this.site.get("can_create_tag");
+ return this.get("computedTags").length < this.get("siteSettings.max_tags_per_topic");
},
filterComputedContent(computedContent) {