You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/05/24 20:48:54 UTC

[10/15] git commit: [#5656] ticket:358 Move move_tickets task to ForgeTracker

[#5656] ticket:358 Move move_tickets task to ForgeTracker


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

Branch: refs/heads/master
Commit: 5198a838d7895d41b3422b2a3526ce103512dbe8
Parents: 250337d
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 23 13:29:17 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:42:27 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tasks/tracker_task.py       |   25 ------------------------
 ForgeTracker/forgetracker/tasks.py        |    5 ++++
 ForgeTracker/forgetracker/tracker_main.py |    5 ++-
 3 files changed, 8 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5198a838/Allura/allura/tasks/tracker_task.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/tracker_task.py b/Allura/allura/tasks/tracker_task.py
deleted file mode 100644
index 0a37850..0000000
--- a/Allura/allura/tasks/tracker_task.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#       Licensed to the Apache Software Foundation (ASF) under one
-#       or more contributor license agreements.  See the NOTICE file
-#       distributed with this work for additional information
-#       regarding copyright ownership.  The ASF licenses this file
-#       to you under the Apache License, Version 2.0 (the
-#       "License"); you may not use this file except in compliance
-#       with the License.  You may obtain a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#       Unless required by applicable law or agreed to in writing,
-#       software distributed under the License is distributed on an
-#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#       KIND, either express or implied.  See the License for the
-#       specific language governing permissions and limitations
-#       under the License.
-
-
-from allura.lib.decorators import task
-from pylons import tmpl_context as c
-
-
-@task
-def move_tickets(ticket_ids, destination_tracker_id):
-    c.app.globals.move_tickets(ticket_ids, destination_tracker_id)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5198a838/ForgeTracker/forgetracker/tasks.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tasks.py b/ForgeTracker/forgetracker/tasks.py
index fa0b7bc..6cbd42d 100644
--- a/ForgeTracker/forgetracker/tasks.py
+++ b/ForgeTracker/forgetracker/tasks.py
@@ -32,3 +32,8 @@ def update_bin_counts(app_config_id):
     app = app_config.project.app_instance(app_config)
     with h.push_config(c, app=app):
         app.globals.update_bin_counts()
+
+
+@task
+def move_tickets(ticket_ids, destination_tracker_id):
+    c.app.globals.move_tickets(ticket_ids, destination_tracker_id)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5198a838/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 1534f55..7fbbe9c 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -62,11 +62,12 @@ from allura.controllers import AppDiscussionController, AppDiscussionRestControl
 from allura.controllers import attachments as ac
 from allura.controllers import BaseController
 from allura.controllers.feed import FeedArgs, FeedController
-from allura.tasks import mail_tasks, tracker_task
+from allura.tasks import mail_tasks
 
 # Local imports
 from forgetracker import model as TM
 from forgetracker import version
+from forgetracker import tasks
 
 from forgetracker.widgets.admin import OptionsAdmin
 from forgetracker.widgets.ticket_form import TicketForm, TicketCustomField
@@ -824,7 +825,7 @@ class RootController(BaseController, FeedController):
             _id={'$in': [ObjectId(id) for id in ticket_ids]},
             app_config_id=c.app.config._id)).all()
 
-        tracker_task.move_tickets.post(ticket_ids, destination_tracker_id)
+        tasks.move_tickets.post(ticket_ids, destination_tracker_id)
 
         c.app.globals.invalidate_bin_counts()
         ThreadLocalORMSession.flush_all()