diff --git a/db/Template.go b/db/Template.go index 2402c24c..85a34c63 100644 --- a/db/Template.go +++ b/db/Template.go @@ -131,7 +131,7 @@ func FillTemplate(d Store, template *Template) (err error) { var tasks []TaskWithTpl if err != nil { return - tasks, err = d.GetTemplateTasks(tpl.ProjectID, tpl.ID, RetrieveQueryParams{Count: 1}) + tasks, err = d.GetTemplateTasks(template.ProjectID, template.ID, RetrieveQueryParams{Count: 1}) } if len(tasks) > 0 { template.LastTask = &tasks[0]