mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
Avoid knex warning when destroying a user
no issue - the warning is "Transaction was already complete" - destroying a user happens in a transaction, but the event is not asynchronous - so we have to ensure that we don't operate on a finished transaction
This commit is contained in:
parent
b4f355f713
commit
c6f30a46d2
1 changed files with 2 additions and 2 deletions
|
@ -31,9 +31,9 @@ common.events.on('user.deactivated', function (userModel, options) {
|
|||
return;
|
||||
}
|
||||
|
||||
models.Accesstoken.destroyByUser(options)
|
||||
models.Accesstoken.destroyByUser(_.omit(options, 'transacting'))
|
||||
.then(function () {
|
||||
return models.Refreshtoken.destroyByUser(options);
|
||||
return models.Refreshtoken.destroyByUser(_.omit(options, 'transacting'));
|
||||
})
|
||||
.catch(function (err) {
|
||||
common.logging.error(new common.errors.GhostError({
|
||||
|
|
Loading…
Add table
Reference in a new issue