Merge pull request #38119 from frappe/mergify/bp/develop/pr-37959

fix: Add check for user_id in avatar macro (backport #37959)
This commit is contained in:
Ejaaz Khan 2026-03-18 14:57:48 +05:30 committed by GitHub
commit fc3e55e1e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,9 @@
{% macro avatar(user_id=None, css_style=None, size="avatar-small", full_name=None, image=None) %}
{% set user_info = frappe.utils.get_user_info_for_avatar(user_id) %}
{% if user_id %}
{% set user_info = frappe.utils.get_user_info_for_avatar(user_id) %}
{% else %}
{% set user_info = {} %}
{% endif %}
<span class="avatar {{ size }}" title="{{ full_name|e or user_info.name|e }}" style="{{ css_style or '' }}">
{% if image or user_info.image %}
<img