feat(challenges): even more slur blocker
This commit is contained in:
@@ -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 Habitica’s 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
|
||||
|
||||
Reference in New Issue
Block a user