allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [allura] 04/06: [#8323] Add blog post support for user notifications
Date Tue, 27 Aug 2019 15:37:52 GMT
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit eb3507e4963a02934433d2022ddc609b7e7cdf99
Author: Shalitha Suranga <shalithasuranga@gmail.com>
AuthorDate: Tue Aug 13 21:58:57 2019 +0530

    [#8323] Add blog post support for user notifications
---
 ForgeBlog/forgeblog/main.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ForgeBlog/forgeblog/main.py b/ForgeBlog/forgeblog/main.py
index 66793cb..be0a469 100644
--- a/ForgeBlog/forgeblog/main.py
+++ b/ForgeBlog/forgeblog/main.py
@@ -39,6 +39,7 @@ from allura.app import Application, SitemapEntry, ConfigOption
 from allura.app import DefaultAdminController
 from allura.lib import helpers as h
 from allura.lib.utils import JSONForExport
+from allura.tasks import notification_tasks
 from allura.lib.search import search_app
 from allura.lib.decorators import require_post, memorable_forget
 from allura.lib.security import has_access, require_access
@@ -315,6 +316,7 @@ class RootController(BaseController, FeedController):
                              user=c.user, content_type='blog-post')
         if attachment is not None:
             post.add_multiple_attachments(attachment)
+        notification_tasks.send_usermentions_notification(post, kw['text'])
         redirect(h.really_unicode(post.url()).encode('utf-8'))
 
     @with_trailing_slash
@@ -427,11 +429,13 @@ class PostController(BaseController, FeedController):
             g.spam_checker.check(kw['title'] + u'\n' + kw['text'], artifact=self.post,
                                  user=c.user, content_type='blog-post')
         attachment = kw.pop('attachment', None)
+        old_text = self.post.text
         if attachment is not None:
             self.post.add_multiple_attachments(attachment)
         for k, v in kw.iteritems():
             setattr(self.post, k, v)
         self.post.commit()
+        notification_tasks.send_usermentions_notification(self.post, kw['text'], old_text)
         redirect('.')
 
     @without_trailing_slash


Mime
View raw message