You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2014/07/25 18:03:08 UTC
[2/8] 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/d2753a9f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d2753a9f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d2753a9f
Branch: refs/heads/master
Commit: d2753a9f183c0af8ae416511ebfbeab31c13f656
Parents: 69bdc9f
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Jul 22 12:33:16 2014 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Jul 25 16:02:57 2014 +0000
----------------------------------------------------------------------
Allura/allura/model/auth.py | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/d2753a9f/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index c86f7de..aa5a7a7 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -902,6 +902,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