fix(relations): don't allow creating relations which already exist
Resolves https://github.com/go-vikunja/frontend/issues/144
This commit is contained in:
parent
314b101280
commit
33a47b7f43
@ -165,7 +165,7 @@ func (rel *TaskRelation) Create(s *xorm.Session, a web.Auth) error {
|
||||
exists, err := s.
|
||||
Where("(task_id = ? AND other_task_id = ? AND relation_kind = ?) OR (task_id = ? AND other_task_id = ? AND relation_kind = ?)",
|
||||
rel.TaskID, rel.OtherTaskID, rel.RelationKind, rel.TaskID, rel.OtherTaskID, rel.RelationKind).
|
||||
Exist(rel)
|
||||
Exist(&TaskRelation{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user