Better handling of errors on trial license request (#14886)

* Fix behavior on blank site url on trial requests

* Adding trial license error response handling

* Changing text based on PR review comments
Этот коммит содержится в:
Jesús Espino
2020-06-29 17:22:50 +02:00
коммит произвёл GitHub
родитель 9e12a34e3c
Коммит 05dc928576
3 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@@ -187,6 +187,11 @@ func requestTrialLicense(c *Context, w http.ResponseWriter, r *http.Request) {
Users: usersNumber.Users,
}
if trialLicenseRequest.SiteURL == "" {
c.Err = model.NewAppError("RequestTrialLicense", "api.license.request_trial_license.no-site-url.app_error", nil, "", http.StatusBadRequest)
return
}
if err := c.App.Srv().RequestTrialLicense(trialLicenseRequest); err != nil {
c.Err = err
return