Moved logging to extra parameter
the build was successful
Details
the build was successful
Details
This commit is contained in:
parent
03ec200fe6
commit
ded6886de0
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue