Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B05CE10976 for ; Thu, 26 Sep 2013 16:46:40 +0000 (UTC) Received: (qmail 71913 invoked by uid 500); 26 Sep 2013 16:46:40 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 71895 invoked by uid 500); 26 Sep 2013 16:46:39 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 71887 invoked by uid 99); 26 Sep 2013 16:46:38 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Sep 2013 16:46:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 85D9E90AD70; Thu, 26 Sep 2013 16:46:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tvansteenburgh@apache.org To: allura-commits@incubator.apache.org Message-Id: <9dbf042684fe4371ad027a915c202f42@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: [#6431] Fix places that were still expecting a cursor Date: Thu, 26 Sep 2013 16:46:38 +0000 (UTC) Updated Branches: refs/heads/db/6431 a800eef0f -> b78619465 [#6431] Fix places that were still expecting a cursor Signed-off-by: Tim Van Steenburgh 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 Authored: Thu Sep 26 16:46:20 2013 +0000 Committer: Tim Van Steenburgh 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()