Restore admin notify cooloff and remove debug logs (#22289)

Этот коммит содержится в:
Julien Tant
2023-02-09 06:43:30 -07:00
коммит произвёл GitHub
родитель bd59b112a6
Коммит e325f3fa1c
2 изменённых файлов: 1 добавлений и 26 удалений

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

@@ -7,13 +7,10 @@ import (
"encoding/json"
"net/http"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
"github.com/mattermost/mattermost-server/v6/model"
)
func handleNotifyAdmin(c *Context, w http.ResponseWriter, r *http.Request) {
mlog.Info("enter handleNotifyAdmin")
var notifyAdminRequest *model.NotifyAdminToUpgradeRequest
err := json.NewDecoder(r.Body).Decode(&notifyAdminRequest)
if err != nil {
@@ -27,14 +24,11 @@ func handleNotifyAdmin(c *Context, w http.ResponseWriter, r *http.Request) {
c.Err = appErr
return
}
mlog.Info("exit handleNotifyAdmin")
ReturnStatusOK(w)
}
func handleTriggerNotifyAdminPosts(c *Context, w http.ResponseWriter, r *http.Request) {
mlog.Info("enter handleTriggerNotifyAdminPosts")
if !*c.App.Config().ServiceSettings.EnableAPITriggerAdminNotifications {
c.Err = model.NewAppError("Api4.handleTriggerNotifyAdminPosts", "api.cloud.app_error", nil, "Manual triggering of notifications not allowed", http.StatusForbidden)
return
@@ -59,7 +53,5 @@ func handleTriggerNotifyAdminPosts(c *Context, w http.ResponseWriter, r *http.Re
return
}
mlog.Info("exit handleTriggerNotifyAdminPosts")
ReturnStatusOK(w)
}