MM-40817: Use license interface in Channels (#19678)
* MM-40817: Use license interface in Channels https://mattermost.atlassian.net/browse/MM-40817 ```release-note NONE ``` Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
06c2aa70b0
Коммит
856f9b11af
@@ -256,22 +256,7 @@ func (a *App) RequestLicenseAndAckWarnMetric(c *request.Context, warnMetricId st
|
||||
return model.NewAppError("RequestLicenseAndAckWarnMetric", "api.license.request_trial_license.fail_get_user_count.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
}
|
||||
|
||||
trialLicenseRequest := &model.TrialLicenseRequest{
|
||||
ServerID: a.TelemetryId(),
|
||||
Name: currentUser.GetDisplayName(model.ShowFullName),
|
||||
Email: currentUser.Email,
|
||||
SiteName: *a.Config().TeamSettings.SiteName,
|
||||
SiteURL: *a.Config().ServiceSettings.SiteURL,
|
||||
Users: int(registeredUsersCount),
|
||||
TermsAccepted: true,
|
||||
ReceiveEmailsAccepted: true,
|
||||
}
|
||||
|
||||
if trialLicenseRequest.SiteURL == "" {
|
||||
return model.NewAppError("RequestLicenseAndAckWarnMetric", "api.license.request_trial_license.no-site-url.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if err := a.Srv().RequestTrialLicense(trialLicenseRequest); err != nil {
|
||||
if err := a.Channels().RequestTrialLicense(c.Session().UserId, int(registeredUsersCount), true, true); err != nil {
|
||||
// turn off warn metric warning even in case of StartTrial failure
|
||||
if nerr := a.setWarnMetricsStatusAndNotify(warnMetricId); nerr != nil {
|
||||
return nerr
|
||||
|
||||
Ссылка в новой задаче
Block a user