ietf-tools / ietf-tools/datatracker

Duplicate reviewer roles block assignments

Open
#9,502 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted bug component: review/
Dominant language
Python
Stars
1.1k
Forks
853
Avg merge
1d 4h
Merged PRs (30d)
45

Description

Describe the issue

If a reviewer has more than one "reviewer" role for a review team tied to the same email address, attempting to assign a review to them results in a MultipleObjectsReturned exception.

If the same person has multiple roles with different email addresses for each, there is no problem.

The issue arises, I believe, due to the filtering done in AbstractReviewerQueuePolicy.setup_reviewer_fields() which, if multiple Role objects exist, can cause duplicate PKs in the reviewer field's queryset.

A quick fix by adding a distinct filter should fix this. We may want to add a uniqueness constraint for Role to prevent the initial situation from arising. It is not clear in this case exactly how the duplicate roles were created, but the Roles for the affected review team were recently adjusted by two chairs for a user who had multiple addresses. It seems likely that interleaved edits led to the inconsistent state.

Code of Conduct

Aggregated with agent assistance on 2026-08-18

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at AbstractReviewerQueuePolicy.setup_reviewer_fields(), which the issue identifies as the source of duplicate primary keys in the reviewer queryset. Reproduce the case with multiple reviewer Role objects sharing an email address, then verify that assigning a review no longer raises MultipleObjectsReturned; the issue names no file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend, database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.