From f2e47227f90710448b277db9a6686ebc54e92d2e Mon Sep 17 00:00:00 2001 From: Hanno Schlichting Date: Fri, 15 Apr 2011 16:44:16 +0000 Subject: [PATCH] Fix old-style exception raising svn path=/plone.app.discussion/trunk/; revision=48884 --- plone/app/discussion/browser/comments.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index a6b143f..426ffc5 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -171,8 +171,8 @@ class CommentForm(extensible.ExtensibleForm, form.Form): # Check if conversation is enabled on this content object if not self.__parent__.restrictedTraverse( '@@conversation_view').enabled(): - raise Unauthorized, "Discussion is not enabled for this content\ - object." + raise Unauthorized("Discussion is not enabled for this content " + "object.") # The add-comment view is called on the conversation object conversation = IConversation(self.__parent__) @@ -218,11 +218,10 @@ class CommentForm(extensible.ExtensibleForm, form.Form): comment.author_email = email comment.user_notification = user_notification comment.creation_date = comment.modification_date = datetime.utcnow() - else: - raise Unauthorized, \ - """Anonymous user tries to post a comment, but - anonymous commenting is disabled. Or user - does not have the 'reply to item' permission.""" # pragma: no cover + else: # pragma: no cover + raise Unauthorized("Anonymous user tries to post a comment, but " + "anonymous commenting is disabled. Or user does not have the " + "'reply to item' permission.") # Check if the added comment is a reply to an existing comment # or just a regular reply to the content object.