allow non-relative LOGO_TARGET_PATH (#8307)

This commit is contained in:
ʈᵃᵢ 2019-09-27 19:47:20 -07:00 committed by Maxime Beauchemin
parent 3764d43f7f
commit 7ea769228e
1 changed files with 2 additions and 1 deletions

View File

@ -21,6 +21,7 @@
{% set WARNING_MSG = appbuilder.app.config.get('WARNING_MSG') %}
{% set app_icon_width = appbuilder.app.config.get('APP_ICON_WIDTH', 126) %}
{% set logo_target_path = appbuilder.app.config.get('LOGO_TARGET_PATH') or '/profile/{}/'.format(current_user.username) %}
{% set root_path = logo_target_path if not logo_target_path.startswith('/') else '/superset' + logo_target_path if current_user.username is defined else '#' %}
<div class="navbar navbar-static-top {{menu.extra_classes}}" role="navigation">
<div class="container-fluid">
@ -30,7 +31,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ '/superset' + logo_target_path if current_user.username is defined else '#' }}">
<a class="navbar-brand" href="{{ root_path }}">
<img
width="{{ app_icon_width }}"
src="{{ appbuilder.app_icon }}"