mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Updated options format in email alert method to prevent filter override
refs https://github.com/TryGhost/Team/issues/1826 - doesn't allow `filter` to be overridden by passed in options
This commit is contained in:
parent
6e2579ec9d
commit
e6246b191e
1 changed files with 2 additions and 1 deletions
|
@ -505,7 +505,8 @@ User = ghostBookshelf.Model.extend({
|
|||
} else if (type === 'paid-canceled') {
|
||||
filter += '+paid_subscription_canceled_notification:true';
|
||||
}
|
||||
return this.findAll(_.merge({filter, withRelated: ['roles']}, options)).then((users) => {
|
||||
const updatedOptions = _.merge({}, options, {filter, withRelated: ['roles']});
|
||||
return this.findAll(updatedOptions).then((users) => {
|
||||
return users.toJSON().filter((user) => {
|
||||
return user?.roles?.some((role) => {
|
||||
return ['Owner', 'Administrator'].includes(role.name);
|
||||
|
|
Loading…
Add table
Reference in a new issue