Both issues observed here (the duplicate launchpad/trunk tasks, and the declined distroseries nominations where distroseries tasks exist already) are possible because BugNomination.{approve,decline} do not respect their documentation from IBugNomination. IBugNomination states that approving an approved nomination is a no-op, and declining an approved one raises an exception. However, the implementation in BugNomination doesn't perform those checks.
This means that one can decline a nomination after it has been approved, resulting in those extra distroseries nominations. A further approval of a distroseries nomination crashes because it would create a duplicate bugtask. However, there is a missing UNIQUE index (bug #417636) which allows an approved then declined productseries nomination to be successfully approved again, creating the duplicate launchpad/trunk task as seen above.
I've fixed BugNomination.{approve,reject} to make these situations impossible in my bug nomination export branch, but an attempt to decline an existing task through the web UI will start to OOPS.
Both issues observed here (the duplicate launchpad/trunk tasks, and the declined distroseries nominations where distroseries tasks exist already) are possible because BugNomination. {approve, decline} do not respect their documentation from IBugNomination. IBugNomination states that approving an approved nomination is a no-op, and declining an approved one raises an exception. However, the implementation in BugNomination doesn't perform those checks.
This means that one can decline a nomination after it has been approved, resulting in those extra distroseries nominations. A further approval of a distroseries nomination crashes because it would create a duplicate bugtask. However, there is a missing UNIQUE index (bug #417636) which allows an approved then declined productseries nomination to be successfully approved again, creating the duplicate launchpad/trunk task as seen above.
I've fixed BugNomination. {approve, reject} to make these situations impossible in my bug nomination export branch, but an attempt to decline an existing task through the web UI will start to OOPS.