Switch to side-by-side view

--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -146,14 +146,17 @@
     @expose('json:')
     def suggest_name(self, project_name=None):
         new_name = re.sub("[^A-Za-z0-9]", "", project_name).lower()
-        name_taken = plugin.ProjectRegistrationProvider.get().name_taken(new_name)
-        return dict(suggested_name=new_name, name_taken=name_taken)
+        name_taken_message = plugin.ProjectRegistrationProvider.get().name_taken(new_name)
+        if len(new_name) < 3 or len(new_name) > 15:
+            name_taken_message = "Name must be 3-15 characters long."
+        return dict(suggested_name=new_name, message=name_taken_message)
 
     @expose('json:')
     def check_name(self, project_name=None):
-        allowed = not not h.re_path_portion.match(project_name)
-        name_taken = plugin.ProjectRegistrationProvider.get().name_taken(project_name)
-        return dict(allowed=allowed, name_taken=name_taken)
+        name_taken_message = plugin.ProjectRegistrationProvider.get().name_taken(project_name)
+        if not name_taken_message and not h.re_path_portion.match(project_name):
+            name_taken_message = 'Please use only letters, numbers, and dashes 3-15 characters long.'
+        return dict(message=name_taken_message)
 
     @h.vardec
     @expose()