Code

Ticket #8968: comments-moderation-next-param.diff

File comments-moderation-next-param.diff, 1.2 KB (added by Dmitri Fedortchenko <d@…>, 5 years ago)

I still believe this is a shortcoming...

Line 
1Index: django/contrib/comments/views/moderation.py
2===================================================================
3--- django/contrib/comments/views/moderation.py (revision 10622)
4+++ django/contrib/comments/views/moderation.py (working copy)
5@@ -19,6 +19,8 @@
6             the flagged `comments.comment` object
7     """
8     comment = get_object_or_404(comments.get_model(), pk=comment_id, site__pk=settings.SITE_ID)
9+    if next is None:
10+        next = request.GET.get('next',None)
11 
12     # Flag on POST
13     if request.method == 'POST':
14@@ -56,6 +58,8 @@
15             the flagged `comments.comment` object
16     """
17     comment = get_object_or_404(comments.get_model(), pk=comment_id, site__pk=settings.SITE_ID)
18+    if next is None:
19+        next = request.GET.get('next',None)
20 
21     # Delete on POST
22     if request.method == 'POST':
23@@ -96,7 +100,8 @@
24             the `comments.comment` object for approval
25     """
26     comment = get_object_or_404(comments.get_model(), pk=comment_id, site__pk=settings.SITE_ID)
27-
28+    if next is None:
29+        next = request.GET.get('next',None)
30     # Delete on POST
31     if request.method == 'POST':
32         # Flag the comment as approved.