|
a/Allura/allura/lib/plugin.py |
|
b/Allura/allura/lib/plugin.py |
|
... |
|
... |
463 |
raise forge_exc.ProjectOverlimitError()
|
463 |
raise forge_exc.ProjectOverlimitError()
|
464 |
|
464 |
|
465 |
self.rate_limit(user, neighborhood)
|
465 |
self.rate_limit(user, neighborhood)
|
466 |
|
466 |
|
467 |
if user_project and shortname.startswith('u/'):
|
467 |
if user_project and shortname.startswith('u/'):
|
468 |
shortname = shortname.replace('u/', '', 1)
|
468 |
check_shortname = shortname.replace('u/', '', 1)
|
|
|
469 |
else:
|
|
|
470 |
check_shortname = shortname
|
469 |
if not h.re_project_name.match(shortname):
|
471 |
if not h.re_project_name.match(check_shortname):
|
470 |
raise ValueError('Invalid project shortname: %s' % shortname)
|
472 |
raise ValueError('Invalid project shortname: %s' % shortname)
|
471 |
|
473 |
|
472 |
p = M.Project.query.get(shortname=shortname, neighborhood_id=neighborhood._id)
|
474 |
p = M.Project.query.get(shortname=shortname, neighborhood_id=neighborhood._id)
|
473 |
if p:
|
475 |
if p:
|
474 |
raise forge_exc.ProjectConflict('%s already exists in nbhd %s' % (shortname, neighborhood._id))
|
476 |
raise forge_exc.ProjectConflict('%s already exists in nbhd %s' % (shortname, neighborhood._id))
|