feat(challenges): even more slur blocker

This commit is contained in:
CuriousMagpie
2023-11-14 15:46:16 -05:00
parent e5e91aa78a
commit a771045ca7
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
"communityGuidelines": "Community Guidelines",
"bannedWordUsed": "Oops! Looks like this post contains a swearword or reference to an addictive substance or adult topic (<%= swearWordsUsed %>). Habitica keeps our chat very clean. Feel free to edit your message so you can post it! You must remove the word, not just censor it.",
"bannedSlurUsed": "Your post contained inappropriate language, and your chat privileges have been revoked.",
"challengeBannedWordsAndSlurs": "Your challenge contains either a swear word or other inappropriate language. Please remove in order to continue with your challenge creation.",
"challengeBannedWordsAndSlurs": "Your Challenge contains one or more words that violate Habiticas community guidelines.",
"party": "Party",
"usernameCopied": "Username copied to clipboard.",
"create": "Create",
@@ -225,7 +225,7 @@ api.createChallenge = {
const validationErrors = req.validationErrors();
if (validationErrors) throw validationErrors;
const { group } = (user, req, req);
const { savedChal, group } = await createChallenge(user, req, res);
// checks challenge for slurs and banned words
if (group.privacy === 'public'
@@ -236,7 +236,7 @@ api.createChallenge = {
throw new BadRequest(res.t('challengeBannedWordsAndSlurs'));
}
const { savedChal } = await createChallenge(user, req, res);
await user.save();
const response = savedChal.toJSON();
response.leader = { // the leader is the authenticated user