feat: auto-provision default buckets for any manual-bucket view

This commit is contained in:
kolaente 2026-04-12 18:22:29 +02:00
parent a0cc76c4c8
commit 939eba7b44
1 changed files with 5 additions and 3 deletions

View File

@ -312,7 +312,7 @@ func createProjectView(s *xorm.Session, p *ProjectView, a web.Auth, createBacklo
return
}
if p.ViewKind == ProjectViewKindKanban && createBacklogBucket && p.BucketConfigurationMode == BucketConfigurationModeManual {
if createBacklogBucket && p.BucketConfigurationMode == BucketConfigurationModeManual {
// Create default buckets for kanban view
backlog := &Bucket{
ProjectViewID: p.ID,
@ -344,9 +344,11 @@ func createProjectView(s *xorm.Session, p *ProjectView, a web.Auth, createBacklo
return
}
// Set Backlog as default bucket and Done as done bucket
// Set Backlog as default bucket and Done as done bucket (only kanban views use done buckets)
p.DefaultBucketID = backlog.ID
p.DoneBucketID = done.ID
if p.ViewKind == ProjectViewKindKanban {
p.DoneBucketID = done.ID
}
_, err = s.ID(p.ID).Cols("default_bucket_id", "done_bucket_id").Update(p)
if err != nil {
return