You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2014/07/22 14:33:02 UTC

[3/4] git commit: [#7524] ticket:613 Don't track activity if neither project or user are provided

[#7524] ticket:613 Don't track activity if neither project or user are provided


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

Branch: refs/heads/je/42cc_7524
Commit: 368675a6bc1c42172ea2787465748bfe5c1a6ba2
Parents: 94fa2de
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Jul 22 12:33:16 2014 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Tue Jul 22 12:33:16 2014 +0300

----------------------------------------------------------------------
 Allura/allura/model/auth.py | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/368675a6/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index cc2d841..567487a 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -873,6 +873,8 @@ class AuditLog(object):
         elif kwargs:
             message = message % kwargs
         pid = project._id if project is not None else None
+        if pid is None and user is None or user.is_anonymous():
+            return
         return cls(project_id=pid, user_id=user._id, url=url, message=message)
 
     @classmethod