1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-07 03:30:32 -05:00

Resolve the error and consider the free org (#5920)

This commit is contained in:
cyprain-okeke 2025-06-05 18:48:02 +01:00 committed by GitHub
parent 2435063ac8
commit acb18c55b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,13 +78,14 @@ public class OrganizationBillingService(
var isEligibleForSelfHost = await IsEligibleForSelfHostAsync(organization);
var isManaged = organization.Status == OrganizationStatusType.Managed;
var orgOccupiedSeats = await organizationUserRepository.GetOccupiedSeatCountByOrganizationIdAsync(organization.Id);
if (string.IsNullOrWhiteSpace(organization.GatewaySubscriptionId))
{
return OrganizationMetadata.Default with
{
IsEligibleForSelfHost = isEligibleForSelfHost,
IsManaged = isManaged
IsManaged = isManaged,
OrganizationOccupiedSeats = orgOccupiedSeats
};
}
@ -108,8 +109,6 @@ public class OrganizationBillingService(
? await stripeAdapter.InvoiceGetAsync(subscription.LatestInvoiceId, new InvoiceGetOptions())
: null;
var orgOccupiedSeats = await organizationUserRepository.GetOccupiedSeatCountByOrganizationIdAsync(organization.Id);
return new OrganizationMetadata(
isEligibleForSelfHost,
isManaged,