diff --git a/pkg/models/task_collection_test.go b/pkg/models/task_collection_test.go index 39b051d2e3..eee0843e86 100644 --- a/pkg/models/task_collection_test.go +++ b/pkg/models/task_collection_test.go @@ -404,7 +404,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { task21 := &Task{ ID: 21, Title: "task #21", - Identifier: "-1", + Identifier: "#1", Index: 1, CreatedByID: 6, CreatedBy: user6, @@ -417,7 +417,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { task22 := &Task{ ID: 22, Title: "task #22", - Identifier: "-1", + Identifier: "#1", Index: 1, CreatedByID: 6, CreatedBy: user6, @@ -430,7 +430,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { task23 := &Task{ ID: 23, Title: "task #23", - Identifier: "-1", + Identifier: "#1", Index: 1, CreatedByID: 6, CreatedBy: user6, diff --git a/pkg/models/tasks.go b/pkg/models/tasks.go index 2c6c8bd368..0d8559db83 100644 --- a/pkg/models/tasks.go +++ b/pkg/models/tasks.go @@ -579,7 +579,7 @@ func getRemindersForTasks(s *xorm.Session, taskIDs []int64) (reminders []*TaskRe } func (t *Task) setIdentifier(project *Project) { - if project == nil { + if project == nil || (project != nil && project.Identifier == "") { t.Identifier = "#" + strconv.FormatInt(t.Index, 10) return }