fix(task): don't build partial task identifier

This commit is contained in:
kolaente 2023-06-07 20:33:18 +02:00
parent 7b7a914560
commit 4ed2d305f0
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 4 additions and 4 deletions

View File

@ -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,

View File

@ -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
}