fix(projects): do not create buckets in the original project when duplicating a project
This commit is contained in:
parent
8a6689f4fa
commit
1e42e54db1
@ -200,18 +200,20 @@ func duplicateViews(s *xorm.Session, pd *ProjectDuplicate, doer web.Auth, taskMa
|
|||||||
|
|
||||||
oldBucketIDs := []int64{}
|
oldBucketIDs := []int64{}
|
||||||
for _, b := range buckets {
|
for _, b := range buckets {
|
||||||
oldID := b.ID
|
oldBucketID := b.ID
|
||||||
oldBucketIDs = append(oldBucketIDs, oldID)
|
oldViewID := b.ProjectViewID
|
||||||
|
oldBucketIDs = append(oldBucketIDs, oldBucketID)
|
||||||
|
|
||||||
b.ID = 0
|
b.ID = 0
|
||||||
b.ProjectID = pd.Project.ID
|
b.ProjectID = pd.Project.ID
|
||||||
|
b.ProjectViewID = viewMap[oldViewID]
|
||||||
|
|
||||||
err = b.Create(s, doer)
|
err = b.Create(s, doer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
bucketMap[oldID] = b.ID
|
bucketMap[oldBucketID] = b.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
oldTaskBuckets := []*TaskBucket{}
|
oldTaskBuckets := []*TaskBucket{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user