mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-04 04:59:40 +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) {
|
UserSchema.methods.unlink = function(options, cb) {
|
||||||
var cid = options.cid, keep = options.keep, tid = options.tid;
|
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;
|
var self = this;
|
||||||
switch (keep) {
|
switch (keep) {
|
||||||
case 'keep':
|
case 'keep':
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue