You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2019/10/14 21:00:12 UTC
[allura] 07/09: [#8336] Remove more bits of dead code
This is an automated email from the ASF dual-hosted git repository.
brondsem pushed a commit to branch db/8336
in repository https://gitbox.apache.org/repos/asf/allura.git
commit 6c41ad9240b25e81bd6f028e3607799926e19737
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Fri Oct 11 17:54:10 2019 -0400
[#8336] Remove more bits of dead code
---
Allura/allura/model/project.py | 40 ----------------------------------------
1 file changed, 40 deletions(-)
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 304ee95..0776e8f 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -152,24 +152,6 @@ class TroveCategory(MappedClass):
trove = trove.parent_category
return trove.shortname
- @LazyProperty
- def ancestors(self):
- ancestors = []
- trove = self
- while trove:
- ancestors.append(trove)
- trove = trove.parent_category
- return ancestors
-
- @LazyProperty
- def breadcrumbs(self):
- url = '/directory/'
- crumbs = []
- for trove in reversed(self.ancestors[:-1]):
- url += trove.shortname + '/'
- crumbs.append((trove.fullname, url))
- return crumbs
-
@property
def fullpath_within_type(self):
'remove first section of full path, and use nicer separator'
@@ -485,32 +467,10 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
return self
return self.parent_project.root_project
- @LazyProperty
- def project_hierarchy(self):
- if not self.is_root:
- return self.root_project.project_hierarchy
- projects = set([self])
- while True:
- new_projects = set(
- self.query.find(dict(parent_id={'$in': [p._id for p in projects]})))
- new_projects.update(projects)
- if new_projects == projects:
- break
- projects = new_projects
- return projects
-
@property
def category(self):
return ProjectCategory.query.find(dict(_id=self.category_id)).first()
- def roleids_with_permission(self, name):
- roles = set()
- for p in self.parent_iter():
- for ace in p.acl:
- if ace.permission == name and ace.access == ACE.allow:
- roles.add(ace.role_id)
- return list(roles)
-
@classmethod
def icon_urls(cls, projects):
'''Return a dict[project_id] = icon_url, efficiently'''