[v11.0/forgejo] fix: aggregate deleted team as ghost team (#8000)

**Backport:** https://codeberg.org/forgejo/forgejo/pulls/7987

- If a review was requested from a deleted team, use the ghost team for the comment aggregator.
- Resolves Codeberg/Community#1952
- Unit test added.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8000
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
forgejo-backport-action 2025-05-29 18:31:26 +02:00 committed by Gusted
commit dc0d4fb3ad
3 changed files with 42 additions and 2 deletions

View file

@ -649,8 +649,11 @@ func (c *Comment) LoadAssigneeUserAndTeam(ctx context.Context) error {
if c.Issue.Repo.Owner.IsOrganization() {
c.AssigneeTeam, err = organization.GetTeamByID(ctx, c.AssigneeTeamID)
if err != nil && !organization.IsErrTeamNotExist(err) {
return err
if err != nil {
if !organization.IsErrTeamNotExist(err) {
return err
}
c.AssigneeTeam = organization.NewGhostTeam()
}
}
}