{% if request.session.mellon_session %}
  {% with preferred_username=request.session.mellon_session.preferred_username.0 %}
    {{ user.first_name }} {% firstof preferred_username user.last_name %}
  {% endwith %}
{% elif user.attributes %}
  {{ user.first_name }} {% firstof user.attributes.preferred_username user.last_name %}
{% else %}
  {{ user.get_full_name }}
{% endif %}