Ordering '/api/projects' with 'list_id' or 'list_name' doesn't work
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start in patchwork/api/project.py at ProjectList and inspect the ordering_fields used by /api/projects. Reproduce ordering by list_id and list_name, then verify the endpoint no longer raises the reported FieldError for ascending and descending requests.
Written by the indexing model from the issue text.
Description
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?
- 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
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
learningequality/ricecooker#747 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
run-llama/llama_index#23199 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
KhronosGroup/glTF-Blender-IO#2769 ·