Fix base template

current_user is Anonymous when we are not authenticated. Need to check if
email attribute is defined before using it
This commit is contained in:
Khanh Ngo 2020-05-22 17:37:39 +07:00
parent 0ef132a7be
commit a598c52729
No known key found for this signature in database
GPG Key ID: D5FAA6A16150E49E

View File

@ -30,7 +30,7 @@
<body class="hold-transition skin-blue sidebar-mini {% if not SETTING.get('fullscreen_layout') %}layout-boxed{% endif %}">
{% if OFFLINE_MODE %}
{% set gravatar_url = "/static/img/gravatar.png" %}
{% else %}
{% elif current_user.email is defined %}
{% set gravatar_url = current_user.email|email_to_gravatar_url(size=80) %}
{% endif %}
<div class="wrapper">