account.py 481 Bytes
Newer Older
1 2 3 4 5 6 7 8
from django import template

from allauth.account.utils import user_display


register = template.Library()


9 10
@register.simple_tag(name='user_display')
def user_display_tag(user):
11 12 13 14 15 16 17 18 19 20 21 22 23
    """
    Example usage::

        {% user_display user %}

    or if you need to use in a {% blocktrans %}::

        {% user_display user as user_display %}
        {% blocktrans %}
        {{ user_display }} has sent you a gift.
        {% endblocktrans %}

    """
24
    return user_display(user)