[5443] Check if title is empty before save a new dashboard

This commit is contained in:
Pavlos Daoglou
2016-11-29 12:24:34 +02:00
parent f7e8e9c9af
commit 7f7f080ad8
2 changed files with 5 additions and 0 deletions

View File

@ -121,6 +121,10 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) Response {
}
dash := cmd.GetDashboardModel()
// Check if Title is empty
if dash.Title == "" {
return ApiError(400, m.ErrDashboardTitleEmpty.Error(), nil)
}
if dash.Id == 0 {
limitReached, err := middleware.QuotaReached(c, "dashboard")
if err != nil {