allow changing item on tasks with logs.
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-04-03 14:21:39 +02:00
parent 0fd154227f
commit 2c5d87134d
3 changed files with 6 additions and 19 deletions
-18
View File
@@ -86,24 +86,6 @@ func Task(g *gin.RouterGroup, db database.Database) {
return nil, err
}
if update.ItemID != nil && *update.ItemID != task.ItemID {
_, err := l.FindItem(c.Request.Context(), *update.ItemID)
if err != nil {
return nil, err
}
logs, err := l.ListLogs(c.Request.Context(), models.LogFilter{
TaskIDs: []string{task.ID},
})
if err != nil {
return nil, err
}
if len(logs) > 0 {
return nil, slerrors.Forbidden("You cannot change the item if the task has logs.")
}
}
if update.ProjectID != nil && *update.ProjectID != task.ProjectID {
project, err := l.FindProject(c.Request.Context(), *update.ProjectID)
if err != nil {