Duplicate usernames in combo-box when filtering patches by delegate
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 52/100
Research direction
Start in patchwork/filters.py at DelegateFilter around line 458 and inspect _get_delegate_qs for the project-scoped delegate query. Verify how the form receives the current project. Done means the combo-box lists each maintainer of the selected project once and excludes maintainers of other projects.
Written by the indexing model from the issue text.
Description
The combo-box with the list of delegates to filter by has duplicate usernames. It lists a maintainer more than once if he/she maintains multiple projects. It also lists maintainers of other projects who don't maintain the one I'm filtering patches in.
This happens because DelegateFilter's form doesn't filter by project:
https://github.com/getpatchwork/patchwork/blame/bdb049c7939b7cdea1eddf029a0bc47cb338da67/patchwork/filters.py#L458
delegates = User.objects.filter(
profile__maintainer_projects__isnull=False)
Eliminating duplicate rows by using distinct() works, but we still have the issue of different project maintainers being listed in the same list:
delegates = User.objects.filter(
profile__maintainer_projects__isnull=False).distinct()
Maybe we should use _get_delegate_qs instead?
- Dominant language
- Python
- Stars
- 317
- Forks
- 91
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getpatchwork/patchwork
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getpatchwork/patchwork#668 ·
-
bug web-ui
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
getpatchwork/patchwork#546 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
getpatchwork/patchwork#664 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
getpatchwork/patchwork#663 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
getpatchwork/patchwork#645 ·
All issues in getpatchwork/patchwork
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·