Bug: Nominee list shows nominations of you, not nominations you made, and ignores the election
メンテナーはふだん 1 日以内に返信
@jefftriplett がすでに取り組んでいます。
2026年8月14日 から。
評価
調査の方向性
apps/nominations/views.py の NomineeList.get_queryset と apps/nominations/models.py の Nominee.visible() から始め、次に選挙候補者 URL から NomineeDetail リンクをたどってください。選挙が開かれている間の通常のユーザーについて、選挙のスコープと候補者リンクを含むカバレッジを追加してください。完了とは、リストに URL の選挙に関連する候補者だけが表示され、それらのリンクが 404 にならなくなることです。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
Before I let the Robots take over, @jonafato reported this, and I found a second bug while exploring it. Back to the robots...
While an election's nomination window is still open, the nominee list shows you the nominations of you, not the nominations you made for other people. It is also not scoped to the election in the URL, so it mixes in nominees from every past election cycle.
The page tells you it is doing something else. The template prints "Nominations close at ..., this is a preview of only nominations relevant to you."
The cause is in NomineeList.get_queryset (apps/nominations/views.py):
if self.request.user.is_authenticated:
return Nominee.objects.filter(user=self.request.user)
Nominee.user is the person being nominated, so this returns the rows where you are the candidate. The branch above it filters on election=election; this one does not.
There is a second, related problem. Each row in the list links to NomineeDetail, which 404s unless Nominee.visible() passes. visible() (apps/nominations/models.py) returns True only for staff, for the nominee themselves, or after nominations close. So even once the list shows the people you nominated, a non-staff nominator who clicks one of those links gets a 404 during the open window.
NomineeList has no test, which is likely why this went unnoticed.
To Reproduce
- Sign in as an ordinary (non-staff) user.
- Have that user submit a nomination for somebody else in an election whose nomination window is open.
- Go to
/nominations/elections/<election-slug>/nominees/. - The person you nominated is absent. Any election in which somebody nominated you, including closed past elections, is present.
Expected behavior
While nominations are open, the list should show the nominees relevant to you in the election named in the URL. That means the people you nominated, plus your own candidacy if somebody nominated you. Nominees from other election cycles should not appear. Following a link from that list to a nominee you nominated should open the nominee page rather than a 404.
URL to the issue
https://www.python.org/nominations/elections/2026-python-packaging-council/nominees/
Screenshots
""
Browsers
Other
Operating System
Other
Browser Version
No response
Relevant log output
Additional context
This is server-side queryset logic, so it does not depend on the browser or the operating system.
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 702
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/pythondotorg のほかの issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
python/pythondotorg#3149 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
python/pythondotorg#3137 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
app/pages bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
python/pythondotorg#2677 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
backend easy
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
python/pythondotorg#2453 · コメント 8 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
python/pythondotorg#3041 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
python/pythondotorg の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
Harmony OPeNDAP SubSetter (HOSS) Geographic LARC_CLOUD PREFIRE_SAT2_AUX-SAT R01 production
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
nasa/harmony-autotester#245 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Deltares/imod-python#1928 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100