incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [17/22] git commit: [#5656] ticket:358 Flash notification about move task completion
Date Tue, 28 May 2013 19:27:51 GMT
[#5656] ticket:358 Flash notification about move task completion


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/ed74e25d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ed74e25d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ed74e25d

Branch: refs/heads/cj/6218
Commit: ed74e25d1b4c89cdafbd90d23f97c7ac36592096
Parents: 5198a83
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu May 23 14:03:53 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri May 24 18:42:27 2013 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/model/ticket.py          |    4 ++++
 .../forgetracker/tests/functional/test_root.py     |   13 +++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ed74e25d/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index b1144db..24a5d08 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -278,6 +278,10 @@ class Globals(MappedClass):
                 text = tmpl.render(tmpl_context),
                 destinations = [monitoring_email]))
             mail_tasks.sendmail.post(**mail)
+        moved_from = '%s/%s' % (c.project.shortname, c.app.config.options.mount_point)
+        moved_to = '%s/%s' % (tracker.project.shortname, tracker.options.mount_point)
+        text = 'Tickets moved from %s to %s' % (moved_from, moved_to)
+        Notification.post_user(c.user, None, 'flash', text=text)
 
     def filtered_by_subscription(self, tickets, project_id=None, app_config_id=None):
         p_id = project_id if project_id else c.project._id

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ed74e25d/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 0d129a3..1f4acf4 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -2235,14 +2235,14 @@ class TestBulkMove(TrackerTestController):
         M.MonQTask.run_ready()
 
     def test_access_restriction(self):
-       self.app.get('/bugs/move/', status=200)
-       self.app.get('/bugs/move/',
+        self.app.get('/bugs/move/', status=200)
+        self.app.get('/bugs/move/',
                     extra_environ={'username': 'test-user-0'},
                     status=403)
-       self.app.get('/bugs/move/',
+        self.app.get('/bugs/move/',
                     extra_environ={'username': '*anonymous'},
                     status=302)
-       self.app.post('/bugs/move_tickets',
+        self.app.post('/bugs/move_tickets',
                      extra_environ={'username': 'test-user-0'},
                      status=403)
 
@@ -2353,6 +2353,11 @@ class TestBulkMove(TrackerTestController):
         assert_in(first_ticket_changes, admin_email.kwargs.text)
         assert_in(second_ticket_changes, admin_email.kwargs.text)
         assert_in(third_ticket_changes, admin_email.kwargs.text)
+        # After tickets moved, user should see a flash
+        mbox = M.Mailbox.query.get(user_id=admin._id, is_flash=True)
+        notification_id = mbox.queue[-1]
+        notification = M.Notification.query.get(_id=notification_id)
+        assert_equal(notification.text, 'Tickets moved from test/bugs to test2/bugs2')
 
     @td.with_tool('test2', 'Tickets', 'bugs2')
     def test_monitoring_email(self):


Mime
View raw message