Add check if the list exist
This commit is contained in:
parent
003cf85d05
commit
1f671e65bf
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user