fix(tasks): return a correct task identifier if the list does not have a good one set
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
kolaente 2023-06-07 18:17:08 +02:00
parent 1a840c8b87
commit 69bd023b62
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 5 additions and 2 deletions

View File

@ -151,6 +151,9 @@ func (*Task) TableName() string {
// GetFullIdentifier returns the task identifier if the task has one and the index prefixed with # otherwise.
func (t *Task) GetFullIdentifier() string {
if t.Identifier != "" {
if strings.HasPrefix(t.Identifier, "-") {
return "#" + strings.TrimPrefix(t.Identifier, "-")
}
return t.Identifier
}