Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Pastebin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
diff --git Allura/allura/lib/plugin.py Allura/allura/lib/plugin.py
index 76a18ae..7626bdb 100644
--- Allura/allura/lib/plugin.py
+++ Allura/allura/lib/plugin.py
@@ -469,7 +469,7 @@ def validate_project(self, neighborhood, shortname, project_name, user, user_pro
             check_shortname = shortname
         allowed, err = self.allowed_project_shortname(check_shortname, neighborhood)
         if not allowed:
-            raise ValueError('Invalid project shortname: %s' % shortname)
+            raise ValueError('Invalid project shortname: %s error: %s' % (shortname, err))
 
         p = M.Project.query.get(shortname=shortname, neighborhood_id=neighborhood._id)
         if p:





>>> from allura.model import Neighborhood
>>> from allura.model import User
>>> from allura.lib.plugin import ProjectRegistrationProvider
>>> ProjectRegistrationProvider().validate_project(Neighborhood.query.get(url_prefix='/u/'), 'u/??????', 'blah', User.query.get(username='admin1'), user_project=True, private_project=False)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/dbrondsema/dbrondsema-1019/forge/Allura/allura/lib/plugin.py", line 472, in validate_project
    raise ValueError('Invalid project shortname: %s error: %s' % (shortname, err))
ValueError: Invalid project shortname: u/?????? error: Please use only letters, numbers, and dashes 3-15 characters long.