Merge pull request #5504 from Alys/cid-2015-06-25

prevent challenge tasks being deleted when challenge ID has been lost
This commit is contained in:
Blade Barringer 2015-06-27 17:07:10 -05:00
commit 5c4732304a

View file

@ -539,6 +539,9 @@ UserSchema.pre('save', function(next) {
UserSchema.methods.unlink = function(options, cb) {
var cid = options.cid, keep = options.keep, tid = options.tid;
if (!cid) {
return cb("Could not remove challenge tasks. Please delete them manually.");
}
var self = this;
switch (keep) {
case 'keep':