~ubuntu-branches/ubuntu/saucy/python-django/saucy-updates

« back to all changes in this revision

Viewing changes to django/contrib/comments/views/moderation.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone, Jakub Wilk, Luke Faraone
  • Date: 2013-05-09 15:10:47 UTC
  • mfrom: (1.1.21) (4.4.27 sid)
  • Revision ID: package-import@ubuntu.com-20130509151047-aqv8d71oj9wvcv8c
Tags: 1.5.1-2
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Luke Faraone ]
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
    """
17
17
    Flags a comment. Confirmation on GET, action on POST.
18
18
 
19
 
    Templates: `comments/flag.html`,
 
19
    Templates: :template:`comments/flag.html`,
20
20
    Context:
21
21
        comment
22
22
            the flagged `comments.comment` object
26
26
    # Flag on POST
27
27
    if request.method == 'POST':
28
28
        perform_flag(request, comment)
29
 
        return next_redirect(request, next, flag_done, c=comment.pk)
 
29
        return next_redirect(request, fallback=next or 'comments-flag-done',
 
30
            c=comment.pk)
30
31
 
31
32
    # Render a form on GET
32
33
    else:
42
43
    Deletes a comment. Confirmation on GET, action on POST. Requires the "can
43
44
    moderate comments" permission.
44
45
 
45
 
    Templates: `comments/delete.html`,
 
46
    Templates: :template:`comments/delete.html`,
46
47
    Context:
47
48
        comment
48
49
            the flagged `comments.comment` object
53
54
    if request.method == 'POST':
54
55
        # Flag the comment as deleted instead of actually deleting it.
55
56
        perform_delete(request, comment)
56
 
        return next_redirect(request, next, delete_done, c=comment.pk)
 
57
        return next_redirect(request, fallback=next or 'comments-delete-done',
 
58
            c=comment.pk)
57
59
 
58
60
    # Render a form on GET
59
61
    else:
69
71
    Approve a comment (that is, mark it as public and non-removed). Confirmation
70
72
    on GET, action on POST. Requires the "can moderate comments" permission.
71
73
 
72
 
    Templates: `comments/approve.html`,
 
74
    Templates: :template:`comments/approve.html`,
73
75
    Context:
74
76
        comment
75
77
            the `comments.comment` object for approval
80
82
    if request.method == 'POST':
81
83
        # Flag the comment as approved.
82
84
        perform_approve(request, comment)
83
 
        return next_redirect(request, next, approve_done, c=comment.pk)
 
85
        return next_redirect(request, fallback=next or 'comments-approve-done',
 
86
            c=comment.pk)
84
87
 
85
88
    # Render a form on GET
86
89
    else: