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 91E3BF969 for ; Thu, 21 Mar 2013 14:21:41 +0000 (UTC) Received: (qmail 74622 invoked by uid 500); 21 Mar 2013 14:21:41 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 74525 invoked by uid 500); 21 Mar 2013 14:21:41 -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 73651 invoked by uid 99); 21 Mar 2013 14:21: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, 21 Mar 2013 14:21:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C9EDE3EFB5; Thu, 21 Mar 2013 14:21: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 Date: Thu, 21 Mar 2013 14:22:17 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [41/48] git commit: [#5453] Fixed bug in userstats model [#5453] Fixed bug in userstats model Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/406dc65f Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/406dc65f Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/406dc65f Branch: refs/heads/si/5453 Commit: 406dc65f49732e9487a68b48f920f43545b35d39 Parents: ea7b708 Author: Stefano Invernizzi Authored: Sat Mar 9 16:34:02 2013 +0100 Committer: Tim Van Steenburgh Committed: Thu Mar 21 14:20:56 2013 +0000 ---------------------------------------------------------------------- ForgeUserStats/forgeuserstats/model/stats.py | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/406dc65f/ForgeUserStats/forgeuserstats/model/stats.py ---------------------------------------------------------------------- diff --git a/ForgeUserStats/forgeuserstats/model/stats.py b/ForgeUserStats/forgeuserstats/model/stats.py index 8575e79..4171d52 100644 --- a/ForgeUserStats/forgeuserstats/model/stats.py +++ b/ForgeUserStats/forgeuserstats/model/stats.py @@ -25,8 +25,10 @@ class UserStats(Stats): stats = cls(user_id=user._id, registration_date = datetime.utcnow()) user.stats_id = stats._id - session(stats).flush(stats) - session(user).flush(user) + if session(stats): + session(stats).flush(stats) + if session(user): + session(user).flush(user) return stats def getLastMonthLogins(self):