mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 20:34:02 +03:00
Merge pull request #802 from jgable/importer003
This commit is contained in:
commit
06c3b2dc25
@ -363,8 +363,9 @@ adminControllers = {
|
||||
};
|
||||
|
||||
return api.notifications.add(notification).then(function () {
|
||||
delete req.session.user;
|
||||
res.redirect('/ghost/signin/');
|
||||
// temp no commit
|
||||
//delete req.session.user;
|
||||
res.redirect('/ghost/debug/');
|
||||
});
|
||||
|
||||
}, function importFailure(error) {
|
||||
|
@ -11,7 +11,9 @@ Importer000 = function () {
|
||||
this.version = "000";
|
||||
|
||||
this.importFrom = {
|
||||
"000": this.basicImport
|
||||
"000": this.basicImport,
|
||||
"001": this.tempImport,
|
||||
"002": this.tempImport
|
||||
};
|
||||
};
|
||||
|
||||
@ -29,7 +31,7 @@ Importer000.prototype.canImport = function (data) {
|
||||
return when.resolve(this.importFrom[data.meta.version]);
|
||||
}
|
||||
|
||||
return when.reject("Unsupported version of data");
|
||||
return when.reject("Unsupported version of data: " + data.meta.version);
|
||||
};
|
||||
|
||||
|
||||
|
@ -13,5 +13,19 @@ module.exports = function (version, data) {
|
||||
return when.reject("No importer found");
|
||||
}
|
||||
|
||||
return importer.importData(data);
|
||||
return importer.importData(data).otherwise(function (err) {
|
||||
if (err === "Unsupported version of data: 001" || err === "Unsupported version of data: 002") {
|
||||
try {
|
||||
importer = require("./temp.js");
|
||||
} catch (ignore) {
|
||||
// Zero effs given
|
||||
}
|
||||
|
||||
if (!importer) {
|
||||
return when.reject("No importer found");
|
||||
}
|
||||
|
||||
return importer.importData(data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user