FIX: do not allow posting of category topic template without any changes

This commit is contained in:
Arpit Jalan 2019-09-16 16:22:48 +05:30
parent b282c893b2
commit 671ffc4e06
2 changed files with 12 additions and 0 deletions

View File

@ -358,6 +358,17 @@ const Composer = RestModel.extend({
}
}
if (topicFirstPost) {
// user should modify topic template
const category = this.category;
if (category && category.topic_template) {
if (this.reply.trim() === category.topic_template.trim()) {
bootbox.alert(I18n.t("composer.error.topic_template_not_modified"))
return true;
}
}
}
if (this.privateMessage) {
// need at least one user when sending a PM
return (

View File

@ -1626,6 +1626,7 @@ en:
try_like: "Have you tried the {{heart}} button?"
category_missing: "You must choose a category"
tags_missing: "You must choose at least {{count}} tags"
topic_template_not_modified: "You have not modified the topic template. Please update the topic."
save_edit: "Save Edit"
overwrite_edit: "Overwrite Edit"