0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

🎨 Importer no longer imports the slack hook

no issue

- from now on: you have to manually reconfigure your slack hook after importing your data
- we were running into trouble that Ghost had import slack hooks, because it can happen very fast
  that you are importing someone's slack hook
This commit is contained in:
kirrg001 2018-06-07 10:14:06 +02:00
parent 839d82b398
commit a66478576f
3 changed files with 16 additions and 4 deletions

View file

@ -59,6 +59,11 @@ class SettingsImporter extends BaseImporter {
// Ensures things that are enabled in new versions, are turned on
obj.value = JSON.stringify(_.assign({}, JSON.parse(obj.value), labsDefaults));
}
// CASE: we do not import slack hooks, otherwise it can happen very fast that you are pinging someone's slack channel
if (obj.key === 'slack') {
obj.value = '';
}
});
return super.beforeImport();

View file

@ -1877,8 +1877,8 @@ describe('Import (new test structure)', function () {
});
});
describe('amp/comment', function () {
before(function doImport() {
describe('default', function () {
beforeEach(function doImport() {
// initialize the blog with some data
return testUtils.initFixtures('roles', 'owner', 'settings').then(function () {
return testUtils.fixtures.loadExportFixture('export-basic-test');
@ -1888,7 +1888,14 @@ describe('Import (new test structure)', function () {
});
});
it('keeps the value of the amp field', function () {
it('does not import slack hook', function () {
return models.Settings.findOne(_.merge({key: 'slack'}, testUtils.context.internal))
.then(function (response) {
response.attributes.value.should.eql('');
});
});
it('keeps the value of the amp field / uses comment_id', function () {
return models.Post.findPage(_.merge({formats: 'amp'}, testUtils.context.internal)).then(function (response) {
should.exist(response.posts);

View file

@ -1419,7 +1419,7 @@
{
"id": "59a952c2ebbf7206b369cdd6",
"key": "slack",
"value": "[{\"url\":\"\"}]",
"value": "[{\"url\":\"https://hook.slack.com\"}]",
"type": "blog",
"created_at": "2017-09-01T12:18:30.000Z",
"created_by": "1",