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/05/03 23:57:51 UTC

[21/50] git commit: [#6179] don't change 'shortname' var

[#6179] don't change 'shortname' var


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

Branch: refs/heads/db/6007
Commit: 3d3f199782450d1c497a8146528dfe17b2f8c62f
Parents: f746109
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Tue Apr 30 18:30:58 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Apr 30 18:30:58 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/plugin.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3d3f1997/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 02aae3a..3bb1655 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -465,8 +465,10 @@ class ProjectRegistrationProvider(object):
         self.rate_limit(user, neighborhood)
 
         if user_project and shortname.startswith('u/'):
-            shortname = shortname.replace('u/', '', 1)
-        if not h.re_project_name.match(shortname):
+            check_shortname = shortname.replace('u/', '', 1)
+        else:
+            check_shortname = shortname
+        if not h.re_project_name.match(check_shortname):
             raise ValueError('Invalid project shortname: %s' % shortname)
 
         p = M.Project.query.get(shortname=shortname, neighborhood_id=neighborhood._id)