MM-45542 - do not fail if site url is not set when requesting trial (#20713)
* MM-45542 - do not fail if site url is not set when requesting trial * remove unnecessary text Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
334b199e7a
Коммит
e7156476fa
@@ -212,14 +212,6 @@ func TestRequestTrialLicense(t *testing.T) {
|
|||||||
CheckForbiddenStatus(t, resp)
|
CheckForbiddenStatus(t, resp)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("blank site url", func(t *testing.T) {
|
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.SiteURL = "" })
|
|
||||||
defer th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.SiteURL = "http://localhost:8065/" })
|
|
||||||
resp, err := th.SystemAdminClient.RequestTrialLicense(1000)
|
|
||||||
CheckErrorID(t, err, "api.license.request_trial_license.no-site-url.app_error")
|
|
||||||
CheckBadRequestStatus(t, resp)
|
|
||||||
})
|
|
||||||
|
|
||||||
t.Run("trial license user count less than current users", func(t *testing.T) {
|
t.Run("trial license user count less than current users", func(t *testing.T) {
|
||||||
nUsers := 1
|
nUsers := 1
|
||||||
license := model.NewTestLicense()
|
license := model.NewTestLicense()
|
||||||
|
|||||||
@@ -71,10 +71,6 @@ func (w *licenseWrapper) RequestTrialLicense(requesterID string, users int, term
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if *w.srv.Config().ServiceSettings.SiteURL == "" {
|
|
||||||
return model.NewAppError("RequestTrialLicense", "api.license.request_trial_license.no-site-url.app_error", nil, "", http.StatusBadRequest)
|
|
||||||
}
|
|
||||||
|
|
||||||
trialLicenseRequest := &model.TrialLicenseRequest{
|
trialLicenseRequest := &model.TrialLicenseRequest{
|
||||||
ServerID: w.srv.TelemetryId(),
|
ServerID: w.srv.TelemetryId(),
|
||||||
Name: requester.GetDisplayName(model.ShowFullName),
|
Name: requester.GetDisplayName(model.ShowFullName),
|
||||||
|
|||||||
@@ -2053,10 +2053,6 @@
|
|||||||
"id": "api.license.request_trial_license.fail_get_user_count.app_error",
|
"id": "api.license.request_trial_license.fail_get_user_count.app_error",
|
||||||
"translation": "Unable to get a trial license, please try again or contact with support@mattermost.com. Cannot obtain the number of registered users."
|
"translation": "Unable to get a trial license, please try again or contact with support@mattermost.com. Cannot obtain the number of registered users."
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "api.license.request_trial_license.no-site-url.app_error",
|
|
||||||
"translation": "Unable to request a trial license. Please configure a Site URL in the web server section of the Mattermost System Console."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "api.license.upgrade_needed.app_error",
|
"id": "api.license.upgrade_needed.app_error",
|
||||||
"translation": "Feature requires an upgrade to Enterprise Edition."
|
"translation": "Feature requires an upgrade to Enterprise Edition."
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user