Moved logging to extra parameter
the build was successful Details

This commit is contained in:
konrad 2018-11-30 22:16:34 +01:00
parent 03ec200fe6
commit ded6886de0
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 4 additions and 4 deletions

View File

@ -17,9 +17,9 @@
package crud
import (
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/web"
"github.com/labstack/echo"
"github.com/op/go-logging"
"net/http"
)
@ -45,7 +45,7 @@ func (c *WebHandler) DeleteWeb(ctx echo.Context) error {
return echo.NewHTTPError(http.StatusInternalServerError)
}
if !currentStruct.CanDelete(currentAuth) {
log.Log.Noticef("Tried to delete while not having the rights for it", currentAuth)
ctx.Get("LoggingProvider").(*logging.Logger).Noticef("Tried to delete while not having the rights for it", currentAuth)
return echo.NewHTTPError(http.StatusForbidden)
}

View File

@ -17,9 +17,9 @@
package crud
import (
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/web"
"github.com/labstack/echo"
"github.com/op/go-logging"
"net/http"
)
@ -46,7 +46,7 @@ func (c *WebHandler) UpdateWeb(ctx echo.Context) error {
return echo.NewHTTPError(http.StatusInternalServerError, "Could not determine the current user.")
}
if !currentStruct.CanUpdate(currentAuth) {
log.Log.Noticef("Tried to update while not having the rights for it", currentAuth)
ctx.Get("LoggingProvider").(*logging.Logger).Noticef("Tried to update while not having the rights for it", currentAuth)
return echo.NewHTTPError(http.StatusForbidden)
}