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 2013/06/25 04:57:20 UTC

git commit: [#6053] use anonymous user if the test's user is not active & found

Updated Branches:
  refs/heads/master 5aeb9c097 -> a14460891


[#6053] use anonymous user if the test's user is not active & found


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

Branch: refs/heads/master
Commit: a14460891717750a9994754fae7a1790f3143fce
Parents: 5aeb9c0
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Tue Jun 25 02:56:59 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Jun 25 02:56:59 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/basetest_neighborhood_root.py | 2 ++
 Allura/allura/controllers/basetest_project_root.py      | 2 ++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a1446089/Allura/allura/controllers/basetest_neighborhood_root.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/basetest_neighborhood_root.py b/Allura/allura/controllers/basetest_neighborhood_root.py
index b4ef16b..6244645 100644
--- a/Allura/allura/controllers/basetest_neighborhood_root.py
+++ b/Allura/allura/controllers/basetest_neighborhood_root.py
@@ -115,6 +115,8 @@ class BasetestNeighborhoodRootController(WsgiDispatchController, NeighborhoodCon
         c.app = None
         c.user = plugin.AuthenticationProvider.get(request).by_username(
             environ.get('username', 'test-admin'))
+        if not c.user:
+            c.user = M.User.anonymous()
         return WsgiDispatchController.__call__(self, environ, start_response)
 
 class DispatchTest(object):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a1446089/Allura/allura/controllers/basetest_project_root.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/basetest_project_root.py b/Allura/allura/controllers/basetest_project_root.py
index 8c48ed6..b73a851 100644
--- a/Allura/allura/controllers/basetest_project_root.py
+++ b/Allura/allura/controllers/basetest_project_root.py
@@ -123,6 +123,8 @@ class BasetestProjectRootController(WsgiDispatchController, ProjectController):
         c.project = M.Project.query.get(shortname='test', neighborhood_id=self.p_nbhd._id)
         auth = plugin.AuthenticationProvider.get(request)
         user = auth.by_username(environ.get('username', 'test-admin'))
+        if not user:
+            user = M.User.anonymous()
         environ['beaker.session']['userid'] = user._id
         c.user = auth.authenticate_request()
         return WsgiDispatchController.__call__(self, environ, start_response)