From 6abd212c57c1286f2d9b80663c1f6d4dd7372d29 Mon Sep 17 00:00:00 2001 From: ce72 Date: Fri, 24 Mar 2023 12:37:07 +0100 Subject: [PATCH] fix(caldav): Do not create label if it exists by title Resolves https://kolaente.dev/vikunja/api/issues/1435 --- pkg/routes/caldav/listStorageProvider.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/routes/caldav/listStorageProvider.go b/pkg/routes/caldav/listStorageProvider.go index 88841670fb..57468cd931 100644 --- a/pkg/routes/caldav/listStorageProvider.go +++ b/pkg/routes/caldav/listStorageProvider.go @@ -411,13 +411,13 @@ func persistLabels(s *xorm.Session, a web.Auth, task *models.Task, labels []*mod return err } - labelMap := make(map[int64]*models.Label) + labelMap := make(map[string]*models.Label) for _, l := range existingLabels { - labelMap[l.ID] = &l.Label + labelMap[l.Title] = &l.Label } for _, label := range labels { - if l, has := labelMap[label.ID]; has { + if l, has := labelMap[label.Title]; has { *label = *l continue }