1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 17:12:49 -05:00

Check to see if cancellation comment is populated before disablement checks (#5468)

This commit is contained in:
Alex Morask
2025-03-05 15:29:51 -05:00
committed by Alex Morask
parent 8da2cde939
commit 382a8f1ac0

View File

@ -40,10 +40,15 @@ public class SubscriptionDeletedHandler : ISubscriptionDeletedHandler
return; return;
} }
if (organizationId.HasValue && if (organizationId.HasValue)
subscription.CancellationDetails.Comment != providerMigrationCancellationComment &&
!subscription.CancellationDetails.Comment.Contains(addedToProviderCancellationComment))
{ {
if (!string.IsNullOrEmpty(subscription.CancellationDetails?.Comment) &&
(subscription.CancellationDetails.Comment == providerMigrationCancellationComment ||
subscription.CancellationDetails.Comment.Contains(addedToProviderCancellationComment)))
{
return;
}
await _organizationService.DisableAsync(organizationId.Value, subscription.CurrentPeriodEnd); await _organizationService.DisableAsync(organizationId.Value, subscription.CurrentPeriodEnd);
} }
else if (userId.HasValue) else if (userId.HasValue)