1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-09 00:41:37 +01:00

Correct seat counts (#1621)

This commit is contained in:
Matt Gibson 2021-10-07 08:05:02 -05:00 committed by GitHub
parent f63a0711dc
commit 5a2d988375
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1499,12 +1499,13 @@ namespace Bit.Core.Services
var ownerEmails = (await _organizationUserRepository.GetManyByMinimumRoleAsync(organization.Id, var ownerEmails = (await _organizationUserRepository.GetManyByMinimumRoleAsync(organization.Id,
OrganizationUserType.Owner)).Select(u => u.Email).Distinct(); OrganizationUserType.Owner)).Select(u => u.Email).Distinct();
var initialSeatCount = organization.Seats.Value;
await AdjustSeatsAsync(organization, seatsToAdd, prorationDate, ownerEmails); await AdjustSeatsAsync(organization, seatsToAdd, prorationDate, ownerEmails);
if (!organization.OwnersNotifiedOfAutoscaling.HasValue) if (!organization.OwnersNotifiedOfAutoscaling.HasValue)
{ {
await _mailService.SendOrganizationAutoscaledEmailAsync(organization, organization.Seats.Value + seatsToAdd, await _mailService.SendOrganizationAutoscaledEmailAsync(organization, initialSeatCount,
ownerEmails); ownerEmails);
organization.OwnersNotifiedOfAutoscaling = DateTime.UtcNow; organization.OwnersNotifiedOfAutoscaling = DateTime.UtcNow;
await _organizationRepository.UpsertAsync(organization); await _organizationRepository.UpsertAsync(organization);