Exemplo n.º 1
0
def get_user_context(user):
    return {
        'username': user.username,
        'email': user.email,
        'first_name': user.first_name,
        'printable_name': user_printable_name(user)
    }
Exemplo n.º 2
0
def get_user_context(user):
    if user:
        return {
            'username': user.username,
            'email': user.email,
            'first_name': user.first_name,
            'printable_name': user_printable_name(user)
        }
    broker = get_broker()
    return {
        'username': broker.slug,
        'email': broker.email,
        'first_name': broker.full_name,
        'printable_name': broker.printable_name
    }