Remove more mentions of reject_comment.

This commit is contained in:
Georg Brandl
2010-11-21 20:49:51 +01:00
parent f9705fc5b7
commit 8e07433256
4 changed files with 3 additions and 21 deletions
+3 -10
View File
@@ -228,8 +228,8 @@ pass the `displayed` keyword argument::
username=username, proposal=proposal,
displayed=False)
You can then create two new views to handle the moderation of comments. The
first will be called when a moderator decides a comment should be accepted and
You can then create a new view to handle the moderation of comments. It
will be called when a moderator decides a comment should be accepted and
displayed::
@app.route('/docs/accept_comment', methods=['POST'])
@@ -239,14 +239,7 @@ displayed::
support.accept_comment(comment_id, moderator=moderator)
return 'OK'
The next is very similar, but used when rejecting a comment::
@app.route('/docs/reject_comment', methods=['POST'])
def reject_comment():
moderator = g.user.moderator if g.user else False
comment_id = request.form.get('id')
support.reject_comment(comment_id, moderator=moderator)
return 'OK'
Rejecting comments happens via comment deletion.
To perform a custom action (such as emailing a moderator) when a new comment is
added but not displayed, you can pass callable to the :class:`~.WebSupport`
-2
View File
@@ -42,5 +42,3 @@ StorageBackend Methods
.. automethod:: StorageBackend.update_username
.. automethod:: StorageBackend.accept_comment
.. automethod:: StorageBackend.reject_comment
-1
View File
@@ -396,7 +396,6 @@ class WebSupport(object):
('getCommentsURL', '_get_comments'),
('processVoteURL', '_process_vote'),
('acceptCommentURL', '_accept_comment'),
('rejectCommentURL', '_reject_comment'),
('deleteCommentURL', '_delete_comment')
]
for key, value in comment_urls:
-8
View File
@@ -113,11 +113,3 @@ class StorageBackend(object):
:param comment_id: The id of the comment being accepted.
"""
raise NotImplementedError()
def reject_comment(self, comment_id):
"""Called when a moderator rejects a comment. The comment should
then be deleted.
:param comment_id: The id of the comment being accepted.
"""
raise NotImplementedError()