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

[15/36] git commit: [#6831] Allow standard browser session to auth REST API

[#6831] Allow standard browser session to auth REST API

Signed-off-by: Cory Johns <ad...@users.sf.net>


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

Branch: refs/heads/cj/6821
Commit: da7f34aeded76e4e2d3b4d45af5ac327f76defa6
Parents: 56e0caf
Author: Cory Johns <ad...@users.sf.net>
Authored: Tue Dec 10 20:30:37 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Dec 12 05:54:17 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/rest.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/da7f34ae/Allura/allura/controllers/rest.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/rest.py b/Allura/allura/controllers/rest.py
index 5c223f5..3566caa 100644
--- a/Allura/allura/controllers/rest.py
+++ b/Allura/allura/controllers/rest.py
@@ -96,12 +96,9 @@ class RestController(object):
 
     @expose()
     def _lookup(self, name, *remainder):
-        api_token = self._authenticate_request()
-        c.api_token = api_token
-        if api_token:
-            c.user = api_token.user
-        else:
-            c.user = M.User.anonymous()
+        c.api_token = self._authenticate_request()
+        if c.api_token:
+            c.user = c.api_token.user
         neighborhood = M.Neighborhood.query.get(url_prefix = '/' + name + '/')
         if not neighborhood: raise exc.HTTPNotFound, name
         return NeighborhoodRestController(neighborhood), remainder