incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [34/50] git commit: [#6431] Fix places that were still expecting a cursor
Date Thu, 03 Oct 2013 17:14:39 GMT
[#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/128a4ddf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/128a4ddf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/128a4ddf

Branch: refs/heads/cj/6422
Commit: 128a4ddf57a697616bea150f38596d99f28ac29a
Parents: 44963d1
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Thu Sep 26 16:46:20 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Tue Oct 1 20:40:42 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/128a4ddf/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/128a4ddf/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