diff --git a/readthedocs/invitations/templatetags/__init__.py b/readthedocs/invitations/templatetags/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/readthedocs/invitations/templatetags/invitations.py b/readthedocs/invitations/templatetags/invitations.py new file mode 100644 index 00000000000..afecea355cd --- /dev/null +++ b/readthedocs/invitations/templatetags/invitations.py @@ -0,0 +1,14 @@ +"""Invitation template filters.""" + +from django import template + +from readthedocs.invitations.models import Invitation + +register = template.Library() + + +@register.filter +def can_revoke_invitation(user, object): + if isinstance(object, Invitation): + return object.can_revoke_invitation(user) + return False