|
|
@ -1743,12 +1743,12 @@ func DeleteRepositoryLabel(id int64, owner *User) (err error) { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TODO remove Repository <> RepositoryLabel relationship
|
|
|
|
if _, err = sess.Delete(&RepositoryRepoLabel{LabelID: id}); err != nil { |
|
|
|
label := &RepositoryLabel{ID: id, OwnerID: owner.ID} |
|
|
|
return fmt.Errorf("remove repository label '%d': %v", id, err) |
|
|
|
if _, err = sess.Delete(label); err != nil { |
|
|
|
} |
|
|
|
|
|
|
|
if _, err = sess.Delete(&RepositoryLabel{ID: id, OwnerID: owner.ID}); err != nil { |
|
|
|
return fmt.Errorf("remove repository label '%d': %v", id, err) |
|
|
|
return fmt.Errorf("remove repository label '%d': %v", id, err) |
|
|
|
} |
|
|
|
} |
|
|
|
sess.Where("label_id = ?", id).Delete(&RepositoryRepoLabel{}) |
|
|
|
|
|
|
|
return sess.Commit() |
|
|
|
return sess.Commit() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|