mirror of
https://github.com/go-gitea/gitea
synced 2024-12-21 17:58:02 +01: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
@ -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 New Issue
Block a user