Skip to content
Browse files

Remove claim code "already claimed" check.

  • Loading branch information...
1 parent 522f93d commit b46b95533de551c57f28ccf42c49c9d14d615963 @brianloveswords brianloveswords committed Nov 11, 2012
Showing with 4 additions and 4 deletions.
  1. +1 −1 models/badge.js
  2. +3 −3 routes/badge.js
View
2 models/badge.js
@@ -341,7 +341,7 @@ Badge.prototype.redeemClaimCode = function redeemClaimCode(code, email) {
const claim = this.getClaimCode(code);
if (!claim)
return null;
- if (claim.claimedBy && claim.claimedBy != email)
+ if (claim.claimedBy && claim.claimedBy !== email)
return false;
claim.claimedBy = email;
return true;
View
6 routes/badge.js
@@ -152,9 +152,9 @@ exports.awardToUser = function awardToUser(req, res, next) {
var email = (form.email || '').trim();
var code = (form.code || '').trim();
var badge = req.badge;
- var couldClaim = badge.redeemClaimCode(code, email);
- if (!couldClaim)
- return res.send({ status: 'already-claimed' })
+ // var couldClaim = badge.redeemClaimCode(code, email);
+ // if (!couldClaim)
+ // return res.send({ status: 'already-claimed' })
badge.awardOrFind(email, function (err, instance) {
if (err) return res.send({ status: 'error', error: err });
badge.save(function (err) {

0 comments on commit b46b955

Please sign in to comment.
Something went wrong with that request. Please try again.