[FIX] forwardport: type error

`groupby` returns an iterator of `(key, list[value])`, not a
recordset. So `BaseModel.__or__` is invalid.

I missed that bit because I didn't bother writing a test where a PR
has more than 6 months and triggers generating / sending emails, but
turns out we do have those in the production database, and as a result
the mergebot hasn't sent an outstanding fw notification since I
deployed 892fce4ddf in early
february (oops).

Thanks to @clbr-odoo for the notification / report of the issue.
This commit is contained in:
Xavier Morel 2025-02-20 14:01:46 +01:00
parent d9b2441549
commit 93a52b5f43

View File

@ -544,9 +544,9 @@ stderr:
# after 6 months, start sending emails
if age > datetime.timedelta(weeks=26):
if author := source.author.email:
emails[author] |= prs
emails[author] = emails[author].union(*prs)
if reviewer := source.reviewed_by.email:
emails[reviewer] |= prs
emails[reviewer] = emails[reviewer].union(*prs)
self.env.ref('runbot_merge.forwardport.reminder')._send(
repository=pr.repository,
pull_request=pr.number,