mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 10:35:55 +01:00
refactor: skip content length check if submitting from post-queue
This commit is contained in:
@@ -88,7 +88,9 @@ module.exports = function (Topics) {
|
|||||||
Topics.checkTitle(data.title);
|
Topics.checkTitle(data.title);
|
||||||
await Topics.validateTags(data.tags, data.cid, uid);
|
await Topics.validateTags(data.tags, data.cid, uid);
|
||||||
data.tags = await Topics.filterTags(data.tags, data.cid);
|
data.tags = await Topics.filterTags(data.tags, data.cid);
|
||||||
|
if (!data.fromQueue) {
|
||||||
Topics.checkContent(data.content);
|
Topics.checkContent(data.content);
|
||||||
|
}
|
||||||
|
|
||||||
const [categoryExists, canCreate, canTag] = await Promise.all([
|
const [categoryExists, canCreate, canTag] = await Promise.all([
|
||||||
categories.exists(data.cid),
|
categories.exists(data.cid),
|
||||||
@@ -165,13 +167,13 @@ module.exports = function (Topics) {
|
|||||||
data.cid = topicData.cid;
|
data.cid = topicData.cid;
|
||||||
|
|
||||||
await guestHandleValid(data);
|
await guestHandleValid(data);
|
||||||
if (!data.fromQueue) {
|
|
||||||
await user.isReadyToPost(uid, data.cid);
|
|
||||||
}
|
|
||||||
if (data.content) {
|
if (data.content) {
|
||||||
data.content = utils.rtrim(data.content);
|
data.content = utils.rtrim(data.content);
|
||||||
}
|
}
|
||||||
|
if (!data.fromQueue) {
|
||||||
|
await user.isReadyToPost(uid, data.cid);
|
||||||
Topics.checkContent(data.content);
|
Topics.checkContent(data.content);
|
||||||
|
}
|
||||||
|
|
||||||
// For replies to scheduled topics, don't have a timestamp older than topic's itself
|
// For replies to scheduled topics, don't have a timestamp older than topic's itself
|
||||||
if (topicData.scheduled) {
|
if (topicData.scheduled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user