|
a/Allura/allura/model/project.py |
|
b/Allura/allura/model/project.py |
|
... |
|
... |
230 |
|
230 |
|
231 |
@property
|
231 |
@property
|
232 |
def parent_project(self):
|
232 |
def parent_project(self):
|
233 |
if self.is_root: return None
|
233 |
if self.is_root: return None
|
234 |
return self.query.get(_id=self.parent_id)
|
234 |
return self.query.get(_id=self.parent_id)
|
|
|
235 |
|
|
|
236 |
def private_project_of(self):
|
|
|
237 |
user = None
|
|
|
238 |
if self.shortname.startswith('u/'):
|
|
|
239 |
from .auth import User
|
|
|
240 |
user = User.query.get(username=self.shortname[2:])
|
|
|
241 |
return user
|
235 |
|
242 |
|
236 |
@LazyProperty
|
243 |
@LazyProperty
|
237 |
def root_project(self):
|
244 |
def root_project(self):
|
238 |
if self.is_root: return self
|
245 |
if self.is_root: return self
|
239 |
return self.parent_project.root_project
|
246 |
return self.parent_project.root_project
|