incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [1/4] git commit: [#6831] Allow standard browser session to auth REST API
Date Thu, 12 Dec 2013 06:08:41 GMT
Updated Branches:
  refs/heads/master 56e0caf8d -> bad824c93


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

Signed-off-by: Cory Johns <admin1@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/master
Commit: da7f34aeded76e4e2d3b4d45af5ac327f76defa6
Parents: 56e0caf
Author: Cory Johns <admin1@users.sf.net>
Authored: Tue Dec 10 20:30:37 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@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


Mime
View raw message