You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/01/21 22:53:16 UTC
[15/16] git commit: Revert "[#5336] Add logging to figure out why
posts can't be deleted"
Revert "[#5336] Add logging to figure out why posts can't be deleted"
This reverts commit a2363141deec662559e7e30b2bc5c12a323a72ee.
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/13e24ab7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/13e24ab7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/13e24ab7
Branch: refs/heads/tv/5336
Commit: 13e24ab739de3403fb0160828b0c74367c250294
Parents: 7c8d7a6
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Mon Jan 21 21:51:09 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Mon Jan 21 21:52:45 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/discuss.py | 10 ----------
.../forgediscussion/controllers/forum.py | 12 ------------
2 files changed, 0 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/13e24ab7/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index f040a7f..4522635 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -1,4 +1,3 @@
-import logging
from urllib import unquote
from datetime import datetime
@@ -22,8 +21,6 @@ from allura.lib.helpers import DateTimeConverter
from allura.lib.widgets import discuss as DW
from .attachments import AttachmentsController, AttachmentController
-log = logging.getLogger(__name__)
-
class pass_validator(object):
def validate(self, v, s):
return v
@@ -331,20 +328,13 @@ class PostController(BaseController):
@require_post()
@validate(pass_validator, error_handler=index)
def moderate(self, **kw):
- log.debug('Moderating post on project "%s"', c.project.shortname)
- log.debug('... requiring access on %r', self.post.thread)
require_access(self.post.thread, 'moderate')
if kw.pop('delete', None):
- log.debug('... deleting post')
self.post.delete()
- log.debug('... updating thread stats')
self.thread.update_stats()
elif kw.pop('spam', None):
- log.debug('... marking post as spam')
self.post.status = 'spam'
- log.debug('... updating thread stats')
self.thread.update_stats()
- log.debug('... redirecting to referrer: %s', request.referer)
redirect(request.referer)
@h.vardec
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/13e24ab7/ForgeDiscussion/forgediscussion/controllers/forum.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/controllers/forum.py b/ForgeDiscussion/forgediscussion/controllers/forum.py
index b37e039..7a81fdd 100644
--- a/ForgeDiscussion/forgediscussion/controllers/forum.py
+++ b/ForgeDiscussion/forgediscussion/controllers/forum.py
@@ -151,28 +151,16 @@ class ForumPostController(PostController):
@require_post()
@validate(pass_validator, error_handler=index)
def moderate(self, **kw):
- log.debug('Moderating post on project "%s"', c.project.shortname)
- log.debug('... requiring access on %r', self.post.thread)
require_access(self.post.thread, 'moderate')
- log.debug('... self.thread.discussion.deleted = %s', self.thread.discussion.deleted)
- log.debug('... has_access(c.app, "configure") = %s', has_access(c.app, 'configure')())
if self.thread.discussion.deleted and not has_access(c.app, 'configure')():
redirect(self.thread.discussion.url()+'deleted')
- log.debug('... validating kw: %s', kw)
args = self.W.moderate_post.validate(kw, None)
- log.debug('... calculating thread stats')
tasks.calc_thread_stats.post(self.post.thread._id)
- log.debug('... calculating forum stats')
tasks.calc_forum_stats(self.post.discussion.shortname)
- log.debug('... "promote" in args?: %s', 'promote' in args)
if args.pop('promote', None):
- log.debug('... promoting thread')
new_thread = self.post.promote()
- log.debug('... recalculating thread stats')
tasks.calc_thread_stats.post(new_thread._id)
- log.debug('... redirecting to referrer: %s', request.referer)
redirect(request.referer)
- log.debug('... calling moderate() on superclass')
super(ForumPostController, self).moderate(**kw)
class ForumModerationController(ModerationController):