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{}
|
||||
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{}
|
||||
|
Loading…
x
Reference in New Issue
Block a user