Skip to content

Commit

Permalink
Add a fallback in case no first name and last name are set (#33617)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincbeck authored Aug 22, 2023
1 parent 41d9be0 commit 62b917a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions airflow/www/templates/appbuilder/navbar_right.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@
<li class="dropdown">
<a class="dropdown-toggle" href="#">
<span class="navbar-user-icon" title="{{ auth_manager.get_user_name() }}">
{% set user_names = auth_manager.get_user_name().split(" ", 1) %}
<span>{% for name in user_names %}{{ name[0].upper() }}{% endfor %}</span>
{% set user_name = auth_manager.get_user_name() %}
{% if user_name %}
{% set user_names = user_name.split(" ", 1) %}
<span>{% for name in user_names %}{{ name[0].upper() }}{% endfor %}</span>
{% else %}
<span class="material-icons">person</span>
{% endif %}
</span>
<b class="caret"></b>
</a>
Expand Down

0 comments on commit 62b917a

Please sign in to comment.