diff --git a/common/models/promo.js b/common/models/promo.js
index 4dedb9a940..ec4970d461 100644
--- a/common/models/promo.js
+++ b/common/models/promo.js
@@ -1,4 +1,4 @@
-import { isAlphanumeric, isHexadecimal } from 'validator';
+import { isAlphanumeric, isMongoId } from 'validator';
import debug from 'debug';
const log = debug('fcc:models:promo');
@@ -6,16 +6,16 @@ const log = debug('fcc:models:promo');
export default function promo(Promo) {
Promo.getButton = function getButton(id, code, type = 'isNot') {
const Job = Promo.app.models.Job;
- if (!id || !isHexadecimal(id)) {
+ if (!id || !isMongoId('' + id)) {
return Promise.reject(new Error(
'Must include job id'
));
}
if (
- !isAlphanumeric(code) &&
+ !isAlphanumeric('' + code) &&
type &&
- !isAlphanumeric(type)
+ !isAlphanumeric('' + type)
) {
return Promise.reject(new Error(
'Code or Type should be an alphanumeric'
diff --git a/seed/challenges/02-data-visualization-certification/react-projects.json b/seed/challenges/02-data-visualization-certification/react-projects.json
index 0ffd41a0ce..ab5d3c306b 100644
--- a/seed/challenges/02-data-visualization-certification/react-projects.json
+++ b/seed/challenges/02-data-visualization-certification/react-projects.json
@@ -127,6 +127,7 @@
"User Story: I can edit these recipes.",
"User Story: I can delete these recipes.",
"User Story: All new recipes I add are saved in my browser's local storage. If I refresh the page, these recipes will still be there.",
+ "Hint: You should prefix your local storage keys on CodePen, i.e. _username_recipes
",
"Remember to use Read-Search-Ask if you get stuck.",
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
"You can get feedback on your project from fellow campers by sharing it in our Code Review Chatroom. You can also share it on Twitter and your city's Campsite (on Facebook)."
diff --git a/server/boot/challenge.js b/server/boot/challenge.js
index d793b9fbfd..b5350d418a 100644
--- a/server/boot/challenge.js
+++ b/server/boot/challenge.js
@@ -431,7 +431,7 @@ module.exports = function(app) {
challengeId = badIdMap[challengeId];
}
- if (!isMongoId(challengeId)) {
+ if (!isMongoId('' + challengeId)) {
challengeId = null;
}
@@ -456,7 +456,7 @@ module.exports = function(app) {
challengeId = badIdMap[challengeId];
}
- if (!isMongoId(challengeId)) {
+ if (!isMongoId('' + challengeId)) {
challengeId = null;
}
diff --git a/server/boot/randomAPIs.js b/server/boot/randomAPIs.js
index 62e4438fad..f7237bf038 100644
--- a/server/boot/randomAPIs.js
+++ b/server/boot/randomAPIs.js
@@ -276,9 +276,7 @@ module.exports = function(app) {
}
function twitch(req, res) {
- res.render('resources/twitch', {
- title: 'Watch us code on Twitch.tv and LiveCoding.tv'
- });
+ res.redirect('https://twitch.tv/freecodecamp');
}
function unsubscribe(req, res, next) {
diff --git a/server/boot/story.js b/server/boot/story.js
index 8857290bc0..55eb3a52c2 100755
--- a/server/boot/story.js
+++ b/server/boot/story.js
@@ -343,7 +343,7 @@ module.exports = function(app) {
}
var url = req.body.data.url;
- if (!validator.isURL(url)) {
+ if (!validator.isURL('' + url)) {
req.flash('errors', {
msg: "The URL you submitted doesn't appear valid"
});
diff --git a/server/views/resources/twitch.jade b/server/views/resources/twitch.jade
deleted file mode 100644
index 1b89b17432..0000000000
--- a/server/views/resources/twitch.jade
+++ /dev/null
@@ -1,68 +0,0 @@
-extends ../layout
-block content
- .col-xs-12
- .panel.panel-info
- .panel-heading.text-center Watch us code on our Twitch.tv channel
- .panel-body.text-center
- .row
- .col-xs-12
- h2 Watch the live stream below or on our
- a(href="http://twitch.tv/freecodecamp", target='_blank') Twitch.tv channel
- | .
- .spacer
- .row
- .col-md-8.col-xs-12
- .embed-responsive.embed-responsive-16by9
- iframe(src='http://www.twitch.tv/freecodecamp/embed', frameborder='0', scrolling='no')
- .col-md-4.col-xs-12
- .visible-sm.visible-xs
- .embed-responsive.embed-responsive-16by9
- iframe(src='http://www.twitch.tv/freecodecamp/chat?popout=', frameborder='0', scrolling='no')
- .visible-md.visible-lg
- .embed-responsive.embed-responsive-twitch-chat
- iframe(src='http://www.twitch.tv/freecodecamp/chat?popout=', frameborder='0', scrolling='no')
- .row
- .col-xs-12
- h2 Check out our scheduled shows. You can add them to your calendar.
- .embed-responsive.embed-responsive-16by9
- iframe.embed-responsive-item(src="https://www.google.com/calendar/embed?src=freecodecamp.com_r06116ile3o6ucpif7s0g281tc%40group.calendar.google.com&ctz=America/New_York&mode=AGENDA" style="border: 0" width="800" height="600" frameborder="0" scrolling="no")
- br
- .row
- .col-xs-12
- h2 Here are some of our previous shows (you can full-screen them):
- .row.negative-20
- .col-xs-12.col-sm-12.col-md-6
- .embed-responsive.embed-responsive-16by9.big-break
- iframe.embed-responsive-item(src='//www.youtube.com/embed/Z_43xApGB9Y')
- p.wrappable.negative-30 link:
- a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/Z_43xApGB9Y
- .col-xs-12.col-sm-12.col-md-6
- .embed-responsive.embed-responsive-16by9.big-break
- iframe.embed-responsive-item(src='//www.youtube.com/embed/PvWHzcebjjQ')
- p.wrappable.negative-30 link:
- a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/PvWHzcebjjQ
- .col-xs-12.col-sm-12.col-md-6
- .embed-responsive.embed-responsive-16by9.big-break
- iframe.embed-responsive-item(src='//www.youtube.com/embed/yHL6mEr-LGY')
- p.wrappable.negative-30 link:
- a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/yHL6mEr-LGY
- .col-xs-12.col-sm-12.col-md-6
- .embed-responsive.embed-responsive-16by9.big-break
- iframe.embed-responsive-item(src='//www.youtube.com/embed/dolG-yRMcPs')
- p.wrappable.negative-30 link:
- a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/dolG-yRMcPs
- .col-xs-12.col-sm-12.col-md-6
- .embed-responsive.embed-responsive-16by9.big-break
- iframe.embed-responsive-item(src='//www.youtube.com/embed/YMz_vrK_KlQ')
- p.wrappable.negative-30 link:
- a(href="http://www.youtube.com/watch/_BErpDdmBOw") http://www.youtube.com/watch/YMz_vrK_KlQ
- .col-xs-12.col-sm-12.col-md-6
- .embed-responsive.embed-responsive-16by9.big-break
- iframe.embed-responsive-item(src='//www.youtube.com/embed/bbFVxaza8Ik')
- p.wrappable.negative-30 link:
- a(href="http://www.youtube.com/watch/S7iRBZJwOAs") http://www.youtube.com/watch/bbFVxaza8Ik
- br
- br
- br
- if !user
- a.btn.btn-cta.signup-btn.btn-primary(href="/login") Start learning to code (it's free)