mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-21 11:14:14 +00:00
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:
commit
5c4732304a
1 changed files with 3 additions and 0 deletions
|
|
@ -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':
|
||||
|
|
|
|||
Loading…
Reference in a new issue