Add check if the list exist

This commit is contained in:
kolaente 2020-02-19 18:24:42 +01:00
parent 003cf85d05
commit 1f671e65bf
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -43,6 +43,12 @@ func (tc *TaskComment) TableName() string {
// Create creates a new task comment
func (tc *TaskComment) Create(a web.Auth) (err error) {
// Check if the task exists
_, err = GetTaskSimple(&Task{ID: tc.TaskID})
if err != nil {
return err
}
tc.AuthorID = a.GetID()
_, err = x.Insert(tc)
return