fix: reset id before creating
(cherry picked from commit c252c8f0cd1c09a74b564e67a855cca4cd436585)
This commit is contained in:
@ -97,7 +97,7 @@ func (lt *LabelTask) Create(s *xorm.Session, auth web.Auth) (err error) {
|
||||
return ErrLabelIsAlreadyOnTask{lt.LabelID, lt.TaskID}
|
||||
}
|
||||
|
||||
// Insert it
|
||||
lt.ID = 0
|
||||
_, err = s.Insert(lt)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -386,7 +386,10 @@ func (t *Task) UpdateTaskLabels(s *xorm.Session, creator web.Auth, labels []*Lab
|
||||
}
|
||||
|
||||
// Insert it
|
||||
_, err = s.Insert(&LabelTask{LabelID: l.ID, TaskID: t.ID})
|
||||
_, err = s.Insert(&LabelTask{
|
||||
LabelID: l.ID,
|
||||
TaskID: t.ID,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user