From e71f33cfc05473643818e2b646b954bd96543482 Mon Sep 17 00:00:00 2001 From: George Stepanek Date: Mon, 2 May 2016 11:09:32 +1200 Subject: [PATCH] Show cheater message directly on user page --- server/boot/user.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/server/boot/user.js b/server/boot/user.js index 3f3e57b049..6c51fc74b2 100644 --- a/server/boot/user.js +++ b/server/boot/user.js @@ -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 you’re 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 you’re the owner of this account contact - team@freecodecamp.com for details. - ` - }); return res.redirect(`/${user.username}`); }