1
0

fix(projects): do not create buckets in the original project when duplicating a project

This commit is contained in:
kolaente 2024-07-17 10:24:47 +02:00
parent 8a6689f4fa
commit 1e42e54db1
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B

View File

@ -200,18 +200,20 @@ func duplicateViews(s *xorm.Session, pd *ProjectDuplicate, doer web.Auth, taskMa
oldBucketIDs := []int64{}
for _, b := range buckets {
oldID := b.ID
oldBucketIDs = append(oldBucketIDs, oldID)
oldBucketID := b.ID
oldViewID := b.ProjectViewID
oldBucketIDs = append(oldBucketIDs, oldBucketID)
b.ID = 0
b.ProjectID = pd.Project.ID
b.ProjectViewID = viewMap[oldViewID]
err = b.Create(s, doer)
if err != nil {
return err
}
bucketMap[oldID] = b.ID
bucketMap[oldBucketID] = b.ID
}
oldTaskBuckets := []*TaskBucket{}