Skip to content

Commit 50a98e0

Browse files
committed
Add admins template filter
Required by readthedocs/ext-theme#612
1 parent 35543cc commit 50a98e0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

readthedocs/core/templatetags/privacy_tags.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ def is_member(user, project):
2222
return AdminPermission.is_member(user, project)
2323

2424

25+
@register.filter
26+
def admins(obj):
27+
"""
28+
Return admin users on the object.
29+
30+
The object could an Organization or a Project.
31+
"""
32+
return AdminPermission.admins(obj)
33+
34+
2535
@register.simple_tag(takes_context=True)
2636
def get_public_projects(context, user):
2737
# 'Exists()' checks if the project has any good builds.

0 commit comments

Comments
 (0)