fix: lint

This commit is contained in:
kolaente 2023-09-07 11:31:35 +02:00
parent bfcefa0217
commit e34f503674
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 4 deletions

View File

@ -17,13 +17,13 @@
package caldav package caldav
import ( import (
"code.vikunja.io/api/pkg/db"
"errors" "errors"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"code.vikunja.io/api/pkg/config" "code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/db"
"code.vikunja.io/api/pkg/log" "code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/models" "code.vikunja.io/api/pkg/models"
"code.vikunja.io/api/pkg/utils" "code.vikunja.io/api/pkg/utils"
@ -91,11 +91,11 @@ func ParseTaskFromVTODO(content string) (vTask *models.Task, err error) {
} }
// We put the vTodo details in a map to be able to handle them more easily // We put the vTodo details in a map to be able to handle them more easily
task := make(map[string]ics.IANAProperty) task := make(map[string]ics.IANAProperty)
var relation *ics.IANAProperty var relation ics.IANAProperty
for _, c := range vTodo.UnknownPropertiesIANAProperties() { for _, c := range vTodo.UnknownPropertiesIANAProperties() {
task[c.IANAToken] = c task[c.IANAToken] = c
if strings.HasPrefix(c.IANAToken, "RELATED-TO") { if strings.HasPrefix(c.IANAToken, "RELATED-TO") {
relation = &c relation = c
} }
} }
@ -139,7 +139,7 @@ func ParseTaskFromVTODO(content string) (vTask *models.Task, err error) {
DoneAt: caldavTimeToTimestamp(task["COMPLETED"]), DoneAt: caldavTimeToTimestamp(task["COMPLETED"]),
} }
if relation != nil { if relation.Value != "" {
s := db.NewSession() s := db.NewSession()
defer s.Close() defer s.Close()