1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-04 20:50:21 -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
No known key found for this signature in database
GPG Key ID: 23E38285B743E3A8

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)