Skip to content

Commit 3abfe77

Browse files
committed
Fix fallout of Role.package_name removal
1 parent 439d63e commit 3abfe77

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

warehouse/admin/views/users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def user_detail(request):
108108
request.db.query(Role)
109109
.join(User)
110110
.filter(Role.user == user)
111-
.order_by(Role.role_name, Role.package_name)
111+
.order_by(Role.role_name, Role.project_id)
112112
.all()
113113
)
114114

warehouse/manage/views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ def __init__(self, request):
5959
def active_projects(self):
6060
""" Return all the projects for with the user is a sole owner """
6161
projects_owned = (
62-
self.request.db.query(Project)
62+
self.request.db.query(Project.id)
6363
.join(Role.project)
6464
.filter(Role.role_name == "Owner", Role.user == self.request.user)
6565
.subquery()
6666
)
6767

6868
with_sole_owner = (
69-
self.request.db.query(Role.package_name)
69+
self.request.db.query(Role.package_id)
7070
.join(projects_owned)
7171
.filter(Role.role_name == "Owner")
72-
.group_by(Role.package_name)
73-
.having(func.count(Role.package_name) == 1)
72+
.group_by(Role.package_id)
73+
.having(func.count(Role.package_id) == 1)
7474
.subquery()
7575
)
7676

warehouse/packaging/models.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ class Role(db.Model):
7070
user = orm.relationship(User, lazy=False)
7171
project = orm.relationship("Project", lazy=False)
7272

73-
@property
74-
def package_name(self):
75-
return project.name
76-
7773
def __gt__(self, other):
7874
"""
7975
Temporary hack to allow us to only display the 'highest' role when

0 commit comments

Comments
 (0)