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/09/17 21:12:17 UTC

[19/20] git commit: [#5822] allow routing to nbhd tools if the tool mount point is not a vaild project name

[#5822] allow routing to nbhd tools if the tool mount point is not a vaild project name


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

Branch: refs/heads/db/5822
Commit: 0e945b3dea494655345c205461413a26c9252373
Parents: 32f56ee
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Sep 11 15:59:19 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Sep 17 18:02:59 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/project.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0e945b3d/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index 9914dc9..e2c7ee8 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -85,9 +85,10 @@ class NeighborhoodController(object):
         provider = plugin.ProjectRegistrationProvider.get()
         try:
             provider.shortname_validator.to_python(pname, check_allowed=False, neighborhood=self.neighborhood)
-        except Invalid as e:
-            raise exc.HTTPNotFound, pname
-        project = M.Project.query.get(shortname=self.prefix + pname, neighborhood_id=self.neighborhood._id)
+        except Invalid:
+            project = None
+        else:
+            project = M.Project.query.get(shortname=self.prefix + pname, neighborhood_id=self.neighborhood._id)
         if project is None and self.prefix == 'u/':
             # create user-project if it is missing
             user = M.User.query.get(username=pname, disabled=False)