Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Ordering '/api/projects' with 'list_id' or 'list_name' doesn't work

オープン
#318 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
api, backend

調査の方向性

patchwork/api/project.py の ProjectList から開始し、/api/projects で使用されている ordering_fields を調査します。list_id と list_name による並べ替えを再現し、その後、昇順および降順のリクエストでエンドポイントが報告された FieldError を発生させなくなったことを確認します。

索引モデルが issue の本文から書いたものです。

説明

api bug

If you set the ordering filter to list_id ascending/descending or list_name ascending/descending in /api/projects, the following exception will be thrown:

FieldError at /api/projects/

Cannot resolve keyword 'link_name' into field. Choices are: bundle, delegationrule, id, linkname, listemail, listid, maintainer_project, name, patch, scm_url, send_notifications, series, subject_match, submission, use_tags, web_url, webscm_url

Suggested fix:

diff --git a/patchwork/api/project.py b/patchwork/api/project.py
index 3609f73..c249f54 100644
--- a/patchwork/api/project.py
+++ b/patchwork/api/project.py
@@ -83,7 +83,7 @@ class ProjectList(ProjectMixin, ListAPIView):

     search_fields = ('link_name', 'list_id', 'list_email', 'web_url',
                      'scm_url', 'webscm_url')
-    ordering_fields = ('id', 'name', 'link_name', 'list_id')
+    ordering_fields = ('id', 'name', 'linkname', 'listid')
     ordering = 'id'

Does this fix look good enough? Should I send a patch?

主要言語
Python
スター
317
フォーク
91
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getpatchwork/patchwork のほかの issue

getpatchwork/patchwork の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。