Fix unnecessary comment when moving issue on the same project column (#33496) (#33499)

Backport #33496 by @lunny

Fix #33482

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Giteabot 2025-02-05 12:41:48 +08:00 committed by GitHub
parent 200cb6140d
commit 2df7d0835a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 17 deletions

View file

@ -38,13 +38,15 @@ func (issue *Issue) projectID(ctx context.Context) int64 {
}
// ProjectColumnID return project column id if issue was assigned to one
func (issue *Issue) ProjectColumnID(ctx context.Context) int64 {
func (issue *Issue) ProjectColumnID(ctx context.Context) (int64, error) {
var ip project_model.ProjectIssue
has, err := db.GetEngine(ctx).Where("issue_id=?", issue.ID).Get(&ip)
if err != nil || !has {
return 0
if err != nil {
return 0, err
} else if !has {
return 0, nil
}
return ip.ProjectColumnID
return ip.ProjectColumnID, nil
}
// LoadIssuesFromColumn load issues assigned to this column