1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

Commented out unreachable code (#4735)

* Commented out unreachable code

* Suppressed compiler warning "async method lacks await"
This commit is contained in:
Conner Turnbull 2024-09-05 09:23:43 -04:00 committed by GitHub
parent 371d51b9c8
commit b6075dff52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -143,27 +143,28 @@ public class ValidateSponsorshipCommand : CancelSponsorshipCommand, IValidateSpo
private async Task CancelSponsorshipAsync(Organization sponsoredOrganization, OrganizationSponsorship sponsorship = null)
{
return;
if (sponsoredOrganization != null)
{
await _paymentService.RemoveOrganizationSponsorshipAsync(sponsoredOrganization, sponsorship);
await _organizationRepository.UpsertAsync(sponsoredOrganization);
await Task.CompletedTask; // this is intentional
try
{
if (sponsorship != null)
{
await _mailService.SendFamiliesForEnterpriseSponsorshipRevertingEmailAsync(
sponsoredOrganization.BillingEmailAddress(),
sponsorship.ValidUntil ?? DateTime.UtcNow.AddDays(15));
}
}
catch (Exception e)
{
_logger.LogError(e, "Error sending Family sponsorship removed email.");
}
}
await base.DeleteSponsorshipAsync(sponsorship);
// if (sponsoredOrganization != null)
// {
// await _paymentService.RemoveOrganizationSponsorshipAsync(sponsoredOrganization, sponsorship);
// await _organizationRepository.UpsertAsync(sponsoredOrganization);
//
// try
// {
// if (sponsorship != null)
// {
// await _mailService.SendFamiliesForEnterpriseSponsorshipRevertingEmailAsync(
// sponsoredOrganization.BillingEmailAddress(),
// sponsorship.ValidUntil ?? DateTime.UtcNow.AddDays(15));
// }
// }
// catch (Exception e)
// {
// _logger.LogError(e, "Error sending Family sponsorship removed email.");
// }
// }
// await base.DeleteSponsorshipAsync(sponsorship);
}
/// <summary>