Call Cloud HandleLicenseChange when license is changed in Cloud (#21583)
* Call Cloud HandleLicenseChange when license is changed in a cloud context * Remove UpdateSubscriptionFromHook as its no longer necessary * Update mocks * Remove another reference * Remove translation Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -13,7 +13,6 @@ import (
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/audit"
|
||||
"github.com/mattermost/mattermost-server/v6/model"
|
||||
"github.com/mattermost/mattermost-server/v6/plugin"
|
||||
"github.com/mattermost/mattermost-server/v6/shared/mlog"
|
||||
)
|
||||
|
||||
@@ -630,23 +629,6 @@ func handleCWSWebhook(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
c.Err = model.NewAppError("SendCloudWelcomeEmail", "api.user.send_cloud_welcome_email.error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
case model.EventTypeSubscriptionChanged:
|
||||
// event.ProductLimits is nil if there was no change
|
||||
if event.ProductLimits != nil {
|
||||
if pluginsEnvironment := c.App.GetPluginsEnvironment(); pluginsEnvironment != nil {
|
||||
pluginsEnvironment.RunMultiPluginHook(func(hooks plugin.Hooks) bool {
|
||||
hooks.OnCloudLimitsUpdated(event.ProductLimits)
|
||||
return true
|
||||
}, plugin.OnCloudLimitsUpdatedID)
|
||||
}
|
||||
c.App.AdjustInProductLimits(event.ProductLimits, event.Subscription)
|
||||
}
|
||||
|
||||
if err := c.App.Cloud().UpdateSubscriptionFromHook(event.ProductLimits, event.Subscription); err != nil {
|
||||
c.Err = model.NewAppError("Api4.handleCWSWebhook", "api.cloud.subscription.update_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
c.Logger.Info("Updated subscription from webhook event")
|
||||
case model.EventTypeTriggerDelinquencyEmail:
|
||||
var emailToTrigger model.DelinquencyEmail
|
||||
if event.DelinquencyEmail != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user