incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject git commit: [#6431] Fix places that were still expecting a cursor
Date Thu, 26 Sep 2013 16:46:38 GMT
Updated Branches:
  refs/heads/db/6431 a800eef0f -> b78619465


[#6431] Fix places that were still expecting a cursor

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


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

Branch: refs/heads/db/6431
Commit: b786194654cde6817a3818645ee1f574fba09b5d
Parents: a800eef
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Thu Sep 26 16:46:20 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Thu Sep 26 16:46:20 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/auth.py                         | 2 +-
 ForgeTracker/forgetracker/tests/unit/test_ticket_model.py | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b7861946/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index 6562d6e..ae08146 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -266,7 +266,7 @@ class AuthController(BaseController):
 
         repos = []
         for p in user.my_projects():
-            for p in [p] + p.direct_subprojects.all():
+            for p in [p] + p.direct_subprojects:
                 for app in p.app_configs:
                     if not issubclass(g.entry_points["tool"][app.tool_name], RepositoryApp):
                         continue

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b7861946/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
index 93450d1..90eba99 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
@@ -20,6 +20,7 @@ from datetime import datetime
 import urllib2
 
 from ming.orm.ormsession import ThreadLocalORMSession
+from ming.orm import session
 from ming import schema
 from nose.tools import raises, assert_raises, assert_equal, assert_in
 
@@ -275,8 +276,11 @@ class TestTicketModel(TrackerTestWithModel):
         TicketAttachment.save_attachment('test_ticket_model.py', ResettableStream(f),
                                             artifact_id=ticket._id)
         ThreadLocalORMSession.flush_all()
-        assert_equal(ticket.attachments.count(), 1)
-        assert_equal(ticket.attachments.first().filename, 'test_ticket_model.py')
+        # need to refetch since attachments are cached
+        session(ticket).expunge(ticket)
+        ticket = Ticket.query.get(_id=ticket._id)
+        assert_equal(len(ticket.attachments), 1)
+        assert_equal(ticket.attachments[0].filename, 'test_ticket_model.py')
 
     def test_json_parents(self):
         ticket = Ticket.new()


Mime
View raw message