This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 62b917a6ac Add a fallback in case no first name and last name are set
(#33617)
62b917a6ac is described below
commit 62b917a6ac61fd6882c377e3b04f72d908f52a58
Author: Vincent <[email protected]>
AuthorDate: Tue Aug 22 12:51:17 2023 -0400
Add a fallback in case no first name and last name are set (#33617)
---
airflow/www/templates/appbuilder/navbar_right.html | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/airflow/www/templates/appbuilder/navbar_right.html
b/airflow/www/templates/appbuilder/navbar_right.html
index 8eec9f9fcf..1ccf28db41 100644
--- a/airflow/www/templates/appbuilder/navbar_right.html
+++ b/airflow/www/templates/appbuilder/navbar_right.html
@@ -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>