|
a/Allura/allura/controllers/project.py |
|
b/Allura/allura/controllers/project.py |
|
... |
|
... |
65 |
if not h.re_path_portion.match(pname):
|
65 |
if not h.re_path_portion.match(pname):
|
66 |
raise exc.HTTPNotFound, pname
|
66 |
raise exc.HTTPNotFound, pname
|
67 |
project = M.Project.query.get(shortname=self.prefix + pname, neighborhood_id=self.neighborhood._id)
|
67 |
project = M.Project.query.get(shortname=self.prefix + pname, neighborhood_id=self.neighborhood._id)
|
68 |
if project is None and self.prefix == 'u/':
|
68 |
if project is None and self.prefix == 'u/':
|
69 |
# create user-project if it is missing
|
69 |
# create user-project if it is missing
|
70 |
user = M.User.query.get(username=pname)
|
70 |
user = M.User.query.get(username=pname, disabled=False)
|
71 |
if user:
|
71 |
if user:
|
72 |
project = self.neighborhood.register_project(
|
72 |
project = self.neighborhood.register_project(
|
73 |
plugin.AuthenticationProvider.get(request).user_project_shortname(user),
|
73 |
plugin.AuthenticationProvider.get(request).user_project_shortname(user),
|
74 |
user=user, user_project=True)
|
74 |
user=user, user_project=True)
|
75 |
if project is None:
|
75 |
if project is None:
|
76 |
# look for neighborhood tools matching the URL
|
76 |
# look for neighborhood tools matching the URL
|
77 |
project = self.neighborhood.neighborhood_project
|
77 |
project = self.neighborhood.neighborhood_project
|
78 |
c.project = project
|
78 |
c.project = project
|
79 |
return ProjectController()._lookup(pname, *remainder)
|
79 |
return ProjectController()._lookup(pname, *remainder)
|
|
|
80 |
if project and self.prefix == 'u/':
|
|
|
81 |
# make sure user-projects are associated with an enabled user
|
|
|
82 |
user = project.user_project_of
|
|
|
83 |
if not user or user.disabled:
|
|
|
84 |
raise exc.HTTPNotFound
|
80 |
if project.database_configured == False:
|
85 |
if project.database_configured == False:
|
81 |
if remainder == ('user_icon',):
|
86 |
if remainder == ('user_icon',):
|
82 |
redirect(g.forge_static('images/user.png'))
|
87 |
redirect(g.forge_static('images/user.png'))
|
83 |
elif c.user.username == pname:
|
88 |
elif c.user.username == pname:
|
84 |
log.info('Configuring %s database for access to %r',
|
89 |
log.info('Configuring %s database for access to %r',
|