mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-22 12:54:53 -05:00
(Re)Load issue labels when changing them (#13007)
(Re)Load issue labels when labels are added or removed This means that the label state that the webhooks produce accurately matches the changes that they are reporting. Fix #10660 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
cda44750cb
commit
5e1c51cdb6
2 changed files with 20 additions and 0 deletions
|
@ -549,6 +549,11 @@ func (issue *Issue) ReplaceLabels(labels []*Label, doer *User) (err error) {
|
|||
}
|
||||
}
|
||||
|
||||
issue.Labels = nil
|
||||
if err = issue.loadLabels(sess); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
|
|
|
@ -670,6 +670,11 @@ func NewIssueLabel(issue *Issue, label *Label, doer *User) (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
issue.Labels = nil
|
||||
if err = issue.loadLabels(sess); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
|
@ -699,6 +704,11 @@ func NewIssueLabels(issue *Issue, labels []*Label, doer *User) (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
issue.Labels = nil
|
||||
if err = issue.loadLabels(sess); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
|
@ -742,5 +752,10 @@ func DeleteIssueLabel(issue *Issue, label *Label, doer *User) (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
issue.Labels = nil
|
||||
if err = issue.loadLabels(sess); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue