diff --git a/app/assets/javascripts/discourse/helpers/application_helpers.js b/app/assets/javascripts/discourse/helpers/application_helpers.js index 9f94b4db3..708c8d08b 100644 --- a/app/assets/javascripts/discourse/helpers/application_helpers.js +++ b/app/assets/javascripts/discourse/helpers/application_helpers.js @@ -14,17 +14,15 @@ Em.Handlebars.helper('bound-avatar', function(user, size, uploadId) { if (Em.isEmpty(user)) { return new safe("
"); } + var username = Em.get(user, 'username'); - if(arguments.length < 4){ - uploadId = Em.get(user, 'uploaded_avatar_id'); - } + if (arguments.length < 4) { uploadId = Em.get(user, 'uploaded_avatar_id'); } - return new safe(Discourse.Utilities.avatarImg({ - size: size, - avatarTemplate: avatarTemplate(username, uploadId) - })); -}, 'username', 'uploaded_avatar_id'); + var avatar = Em.get(user, 'avatar_template') || avatarTemplate(username, uploadId); + + return new safe(Discourse.Utilities.avatarImg({ size: size, avatarTemplate: avatar })); +}, 'username', 'uploaded_avatar_id', 'avatar_template'); /* * Used when we only have a template