You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by st...@apache.org on 2013/03/09 16:34:32 UTC

git commit: [#5453] Fixed bug in userstats model

Updated Branches:
  refs/heads/si/5453 301469aa5 -> 48f53b4a5


[#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/48f53b4a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/48f53b4a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/48f53b4a

Branch: refs/heads/si/5453
Commit: 48f53b4a54634442e9afe1b7a641fd3eef216abb
Parents: 301469a
Author: Stefano Invernizzi <st...@apache.org>
Authored: Sat Mar 9 16:34:02 2013 +0100
Committer: Stefano Invernizzi <st...@apache.org>
Committed: Sat Mar 9 16:34:02 2013 +0100

----------------------------------------------------------------------
 ForgeUserStats/forgeuserstats/model/stats.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/48f53b4a/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):