Show cheater message directly on user page

This commit is contained in:
George Stepanek
2016-05-02 11:09:32 +12:00
parent c8a06f008b
commit e71f33cfc0

View File

@ -322,6 +322,16 @@ module.exports = function(app) {
return data; return data;
}, {}); }, {});
if (userPortfolio.isCheater) {
req.flash('errors', {
msg: dedent`
Upon review, this account has been flagged for academic
dishonesty. If youre the owner of this account contact
team@freecodecamp.com for details.
`
});
}
return buildDisplayChallenges(userPortfolio.challengeMap, timezone) return buildDisplayChallenges(userPortfolio.challengeMap, timezone)
.map(displayChallenges => ({ .map(displayChallenges => ({
...userPortfolio, ...userPortfolio,
@ -377,13 +387,6 @@ module.exports = function(app) {
} }
if (user.isCheater) { if (user.isCheater) {
req.flash('errors', {
msg: dedent`
Upon review, this account has been flagged for academic
dishonesty. If youre the owner of this account contact
team@freecodecamp.com for details.
`
});
return res.redirect(`/${user.username}`); return res.redirect(`/${user.username}`);
} }