Show cheater message directly on user page

pull/8382/head
George Stepanek 2016-05-02 11:09:32 +12:00
parent c8a06f008b
commit e71f33cfc0
1 changed files with 10 additions and 7 deletions

View File

@ -322,6 +322,16 @@ module.exports = function(app) {
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)
.map(displayChallenges => ({
...userPortfolio,
@ -377,13 +387,6 @@ module.exports = function(app) {
}
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}`);
}