mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
🐛 delete all content if subscriber is associated with a post (#7962)
closes #7875 - we need to delete the subscribers before deleting the posts
This commit is contained in:
parent
cc01547eef
commit
72e9f0a95e
4 changed files with 5 additions and 2 deletions
|
@ -92,6 +92,7 @@ db = {
|
||||||
|
|
||||||
function deleteContent() {
|
function deleteContent() {
|
||||||
var collections = [
|
var collections = [
|
||||||
|
models.Subscriber.findAll(queryOpts),
|
||||||
models.Post.findAll(queryOpts),
|
models.Post.findAll(queryOpts),
|
||||||
models.Tag.findAll(queryOpts)
|
models.Tag.findAll(queryOpts)
|
||||||
];
|
];
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe('DB API', function () {
|
||||||
// Keep the DB clean
|
// Keep the DB clean
|
||||||
before(testUtils.teardown);
|
before(testUtils.teardown);
|
||||||
afterEach(testUtils.teardown);
|
afterEach(testUtils.teardown);
|
||||||
beforeEach(testUtils.setup('users:roles', 'settings', 'posts', 'perms:db', 'perms:init'));
|
beforeEach(testUtils.setup('users:roles', 'settings', 'posts', 'subscriber', 'perms:db', 'perms:init'));
|
||||||
|
|
||||||
should.exist(dbAPI);
|
should.exist(dbAPI);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe('Subscribers API', function () {
|
||||||
// Keep the DB clean
|
// Keep the DB clean
|
||||||
before(testUtils.teardown);
|
before(testUtils.teardown);
|
||||||
afterEach(testUtils.teardown);
|
afterEach(testUtils.teardown);
|
||||||
beforeEach(testUtils.setup('users:roles', 'perms:subscriber', 'perms:init', 'subscriber'));
|
beforeEach(testUtils.setup('users:roles', 'perms:subscriber', 'perms:init', 'posts', 'subscriber'));
|
||||||
|
|
||||||
should.exist(SubscribersAPI);
|
should.exist(SubscribersAPI);
|
||||||
|
|
||||||
|
|
|
@ -314,6 +314,8 @@ DataGenerator.Content = {
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DataGenerator.Content.subscribers[0].post_id = DataGenerator.Content.posts[0].id;
|
||||||
|
|
||||||
DataGenerator.forKnex = (function () {
|
DataGenerator.forKnex = (function () {
|
||||||
var posts,
|
var posts,
|
||||||
tags,
|
tags,
|
||||||
|
|
Loading…
Add table
Reference in a new issue