diff --git a/controllers/user.js b/controllers/user.js index eb20c91..0750574 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -181,7 +181,7 @@ exports.signUpCompletion = async (req, res, next) => if(req.body.codeGodfather !== "") { const godfather=await searchIdGodfather(req.body.codeGodfather); - if(godfather) + if(godfather && godfather.id !== req.connectedUser.User.id) // des fois qu'il se serait désigné lui-même comme "parrain" :) req.body.GodfatherId=godfather.id; } await Promise.all([