Fixed staff limit check query to take into account inactive users

refs https://github.com/TryGhost/Team/issues/587

- Users with 'inactive' status should not be counted towards the "staff" limit
This commit is contained in:
Naz 2021-04-08 20:07:24 +12:00
parent 25debab71d
commit de97328c42

View File

@ -74,7 +74,9 @@ export default class LimitsService extends Service {
users: this.store.findAll('user', {reload: true}),
invites: this.store.findAll('invite', {reload: true})
}).then((data) => {
return data.users.length + data.invites.length;
const activeUsers = data.users.filter(u => u.status !== 'inactive');
return activeUsers.length + data.invites.length;
});
}