allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/4] git commit: [#5708] ticket:262 Don't move tracker's Discussion instance with a ticket
Date Thu, 31 Jan 2013 21:59:12 GMT
[#5708] ticket:262 Don't move tracker's Discussion instance with a ticket

All tickets that belongs to the same tracker shares one Discussion instance.
We should re-attach discussion thread to Discussion instance of a destination tracker,
and shouldn't touch discussion of a source tracker.


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

Branch: refs/heads/master
Commit: 7e17d22611e4ffbf2f6155ac5efddcb91c01b8dd
Parents: b470347
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Wed Jan 30 11:26:38 2013 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Thu Jan 31 21:58:47 2013 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/model/ticket.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7e17d226/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 11f70ca..15241c6 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -587,16 +587,14 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
                     session(self).expunge(self)
                     continue
         # move ticket's discussion thread, thus all new commnets will go to a new ticket's
feed
-        self.discussion_thread.discussion.app_config_id = app_config._id
         self.discussion_thread.app_config_id = app_config._id
+        self.discussion_thread.discussion_id = app_config.discussion_id
         for post in self.discussion_thread.posts:
             post.app_config_id = app_config._id
             post.app_id = app_config._id
 
-        session(self.discussion_thread.discussion).flush(self.discussion_thread.discussion)
         session(self.discussion_thread).flush(self.discussion_thread)
         # need this to reset app_config RelationProperty on ticket to a new one
-        session(self.discussion_thread.discussion).expunge(self.discussion_thread.discussion)
         session(self.discussion_thread).expunge(self.discussion_thread)
         session(self).expunge(self)
         ticket = Ticket.query.find(dict(


Mime
View raw message