Skip to content

Commit 87cd68a

Browse files
feat: use series-detail view instead of patch-list for series
- Solved TODOs of patch-list view being used to refer to series - Now we handle series-detail urls in the parser for the Depends-on tag Signed-off-by: Victor Accarini <[email protected]>
1 parent 06c090b commit 87cd68a

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

docs/usage/overview.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ or a cover letter or the web URL to a patch or a series:
154154

155155
Depends-on: <[email protected]>
156156
Depends-on: https://pw.example.com/project/myproject/list?series=1234
157+
Depends-on: https://pw.example.com/project/myproject/series/1234
157158

158159
.. note::
159160

patchwork/parser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,10 @@ def find_series_from_url(url):
10681068
logging.warning('Failed to resolve series or patch URL: %s', url)
10691069
return None
10701070

1071-
# TODO: Use the series detail view here.
1071+
if result.view_name == 'series-detail':
1072+
return Series.objects.get(pk=result.kwargs['series_id'])
1073+
1074+
# Handles series as a patch-list view
10721075
if result.view_name == 'patch-list' and parse_result.query:
10731076
# Parse the query string.
10741077
# This can be replaced with something much friendlier once the

patchwork/templates/patchwork/partials/patch-list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
</td>
180180
<td id="patch-series:{{patch.id}}">
181181
{% if patch.series %}
182-
<a href="?series={{patch.series.id}}">
182+
<a href="{% url 'series-detail' series_id=patch.series.id project_id=project.linkname %}">
183183
{{ patch.series|truncatechars:100 }}
184184
</a>
185185
{% endif %}

patchwork/templates/patchwork/submission.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h1>{{ submission.name }}</h1>
7676
<tr>
7777
<th>Series</th>
7878
<td>
79-
<a href="{% url 'patch-list' project_id=project.linkname %}?series={{ submission.series.id }}">
79+
<a href="{% url 'series-detail' series_id=submission.series.id project_id=project.linkname %}">
8080
{{ submission.series.name }}
8181
</a> |
8282
<button id="toggle-patch-series">expand</button>

releasenotes/notes/add-series-dependencies-6696458586e795c7.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ features:
1313
``Depends-on: <[email protected]>``
1414
Alternatively, the web URL of the patch or series may be given:
1515
``Depends-on: http://patchwork.example.com/project/test/list?series=1111``
16+
``Depends-on: http://patchwork.example.com/project/test/series/1111``
1617
api:
1718
- |
1819
The API version has been updated to v1.4.

0 commit comments

Comments
 (0)