From 3d3c6385650512e24cab94a05e013ebed6817769 Mon Sep 17 00:00:00 2001 From: Katja Suess Date: Sun, 1 Dec 2019 19:47:08 +0100 Subject: [PATCH] Notification moderator: email of commentator added. Link as is but request to log in for moderating comment added. New moderator notification with email and link to commented page and request to login. No links to approve and delete: due to CSRF direct links to modification of Plone objects result in request to confirm. So page with comments is presented to moderator. If already logged in, moderator is on comment to moderate. If not logged in, moderator is on login page with came_from. --- plone/app/discussion/comment.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index 3baca53..9c68738 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -58,12 +58,12 @@ MAIL_NOTIFICATION_MESSAGE = _( MAIL_NOTIFICATION_MESSAGE_MODERATOR = _( u'mail_notification_message_moderator', default=u'A comment on "${title}" ' - u'has been posted here: ${link}\n\n' - u'---\n' - u'${text}\n' + u'has been posted by ${commentator}\n' + u'here: ${link}\n\n' u'---\n\n' - u'Approve comment:\n${link_approve}\n\n' - u'Delete comment:\n${link_delete}\n', + u'${text}\n\n' + u'---\n\n' + u'Log in to moderate.\n\n', ) logger = logging.getLogger('plone.app.discussion') @@ -419,8 +419,6 @@ def notify_moderator(obj, event): # Compose email subject = translate(_(u'A comment has been posted.'), context=obj.REQUEST) - link_approve = obj.absolute_url() + '/@@moderate-publish-comment' - link_delete = obj.absolute_url() + '/@@moderate-delete-comment' message = translate( Message( MAIL_NOTIFICATION_MESSAGE_MODERATOR, @@ -428,8 +426,14 @@ def notify_moderator(obj, event): 'title': safe_unicode(content_object.title), 'link': content_object.absolute_url() + '/view#' + obj.id, 'text': obj.text, - 'link_approve': link_approve, - 'link_delete': link_delete, + 'commentator': obj.author_email or translate( + Message( + _( + u'label_anonymous', + default=u'Anonymous', + ), + ), + ) }, ), context=obj.REQUEST,