1
0

fix: lint

This commit is contained in:
kolaente
2023-10-10 20:35:43 +02:00
parent c9aec495d5
commit 56625b0b90
11 changed files with 31 additions and 31 deletions

View File

@ -403,8 +403,8 @@ func (ltb *LabelTaskBulk) Create(s *xorm.Session, a web.Auth) (err error) {
if err != nil {
return err
}
for _, l := range labels {
task.Labels = append(task.Labels, &l.Label)
for i := range labels {
task.Labels = append(task.Labels, &labels[i].Label)
}
return task.UpdateTaskLabels(s, a, ltb.Labels)
}

View File

@ -210,8 +210,8 @@ func (tl *TeamProject) ReadAll(s *xorm.Session, a web.Auth, search string, page
}
teams := []*Team{}
for _, t := range all {
teams = append(teams, &t.Team)
for i := range all {
teams = append(teams, &all[i].Team)
}
err = addMoreInfoToTeams(s, teams)

View File

@ -217,7 +217,7 @@ func (lu *ProjectUser) ReadAll(s *xorm.Session, a web.Auth, search string, page
// Obfuscate all user emails
for _, u := range all {
u.Email = ""
u.User.Email = ""
}
numberOfTotalItems, err = s.

View File

@ -72,8 +72,8 @@ func (t *Task) updateTaskAssignees(s *xorm.Session, assignees []*user.User, doer
}
t.Assignees = make([]*user.User, 0, len(currentAssignees))
for _, assignee := range currentAssignees {
t.Assignees = append(t.Assignees, &assignee.User)
for i := range currentAssignees {
t.Assignees = append(t.Assignees, &currentAssignees[i].User)
}
// If we don't have any new assignees, delete everything right away. Saves us some hassle.
@ -349,8 +349,8 @@ func (ba *BulkAssignees) Create(s *xorm.Session, a web.Auth) (err error) {
if err != nil {
return err
}
for _, a := range assignees {
task.Assignees = append(task.Assignees, &a.User)
for i := range assignees {
task.Assignees = append(task.Assignees, &assignees[i].User)
}
err = task.updateTaskAssignees(s, ba.Assignees, a)

View File

@ -117,10 +117,10 @@ func getTaskUsersForTasks(s *xorm.Session, taskIDs []int64, cond builder.Cond) (
return
}
for _, assignee := range assignees {
for i := range assignees {
taskUsers = append(taskUsers, &taskUser{
Task: taskMap[assignee.TaskID],
User: &assignee.User,
Task: taskMap[assignees[i].TaskID],
User: &assignees[i].User,
})
}

View File

@ -417,10 +417,10 @@ func addAssigneesToTasks(s *xorm.Session, taskIDs []int64, taskMap map[int64]*Ta
return
}
// Put the assignees in the task map
for _, a := range taskAssignees {
for i, a := range taskAssignees {
if a != nil {
a.Email = "" // Obfuscate the email
taskMap[a.TaskID].Assignees = append(taskMap[a.TaskID].Assignees, &a.User)
a.User.Email = "" // Obfuscate the email
taskMap[a.TaskID].Assignees = append(taskMap[a.TaskID].Assignees, &taskAssignees[i].User)
}
}
@ -436,9 +436,9 @@ func addLabelsToTasks(s *xorm.Session, taskIDs []int64, taskMap map[int64]*Task)
if err != nil {
return
}
for _, l := range labels {
for i, l := range labels {
if l != nil {
taskMap[l.TaskID].Labels = append(taskMap[l.TaskID].Labels, &l.Label)
taskMap[l.TaskID].Labels = append(taskMap[l.TaskID].Labels, &labels[i].Label)
}
}

View File

@ -159,7 +159,7 @@ func addMoreInfoToTeams(s *xorm.Session, teams []*Team) (err error) {
if _, exists := teamMap[u.TeamID]; !exists {
continue
}
u.Email = ""
u.User.Email = ""
teamMap[u.TeamID].Members = append(teamMap[u.TeamID].Members, u)
}