diff options
| author | Georg Brandl <georg@python.org> | 2010-11-21 20:47:32 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2010-11-21 20:47:32 +0100 |
| commit | f9705fc5b7bbfb30870751da40c5f59218d77859 (patch) | |
| tree | b221bdd10710a29ff57381087a41a865dad55d87 /sphinx/websupport | |
| parent | 6d6f7997101df6ff65a9a3f7c5e053b9111feed2 (diff) | |
| download | sphinx-git-f9705fc5b7bbfb30870751da40c5f59218d77859.tar.gz | |
Remove comment rejection; delete is fine for that now.
Diffstat (limited to 'sphinx/websupport')
| -rw-r--r-- | sphinx/websupport/__init__.py | 13 | ||||
| -rw-r--r-- | sphinx/websupport/storage/sqlalchemystorage.py | 8 |
2 files changed, 0 insertions, 21 deletions
diff --git a/sphinx/websupport/__init__.py b/sphinx/websupport/__init__.py index 35696c22c..26392b984 100644 --- a/sphinx/websupport/__init__.py +++ b/sphinx/websupport/__init__.py @@ -383,19 +383,6 @@ class WebSupport(object): raise errors.UserNotAuthorizedError() self.storage.accept_comment(comment_id) - def reject_comment(self, comment_id, moderator=False): - """Reject a comment that is pending moderation. - - This raises :class:`~sphinx.websupport.errors.UserNotAuthorizedError` - if moderator is False. - - :param comment_id: The id of the comment that was accepted. - :param moderator: Whether the user making the request is a moderator. - """ - if not moderator: - raise errors.UserNotAuthorizedError() - self.storage.reject_comment(comment_id) - def _make_base_comment_options(self): """Helper method to create the part of the COMMENT_OPTIONS javascript that remains the same throughout the lifetime of the diff --git a/sphinx/websupport/storage/sqlalchemystorage.py b/sphinx/websupport/storage/sqlalchemystorage.py index 78991639d..b58b1198e 100644 --- a/sphinx/websupport/storage/sqlalchemystorage.py +++ b/sphinx/websupport/storage/sqlalchemystorage.py @@ -172,11 +172,3 @@ class SQLAlchemyStorage(StorageBackend): session.commit() session.close() - - def reject_comment(self, comment_id): - session = Session() - comment = session.query(Comment).filter(Comment.id == comment_id).one() - session.delete(comment) - - session.commit() - session.close() |
