refactor passport so that emails aren't fired if there are errors in save actions

This commit is contained in:
Michael Q Larson
2015-03-31 15:07:34 -07:00
parent 22507de01f
commit a60c5eb92c
3 changed files with 49 additions and 48 deletions

View File

@@ -142,7 +142,7 @@ exports.returnIndividualStory = function(req, res, next) {
try {
var votedObj = story.upVotes.filter(function(a){
return a['upVotedByUsername'] === req.user['profile']['username'];
})
});
if (votedObj.length > 0){
userVoted = true;
}
@@ -314,7 +314,7 @@ exports.storySubmission = function(req, res) {
}
// if duplicate storyLink add unique number
storyLink = (storyCount == 0) ? storyLink : storyLink + ' ' + storyCount;
storyLink = (storyCount === 0) ? storyLink : storyLink + ' ' + storyCount;
var link = data.link;
if (link.search(/^https?:\/\//g) === -1) {