def get_user_display(user, icon=True, link=False):
 if (user is None):
  full_name = pgettext(u'No known user', u'None')
 else:
  full_name = user.first_name
  if (full_name.strip() == u''):
   full_name = user.username
 full_name = escape(full_name)
 if (icon and appsettings.ENABLE_AVATARS):
  if ((user is None) or (user.email == u'noreply@weblate.org')):
   avatar = get_fallback_avatar_url(32)
  else:
   avatar = reverse(u'user_avatar', kwargs={u'user': user.username, u'size': 32})
  full_name = u'<img src="{avatar}" class="avatar" /> {name}'.format(name=full_name, avatar=avatar)
 if (link and (user is not None)):
  return mark_safe(u'<a href="{link}">{name}</a>'.format(name=full_name, link=reverse(u'user_page', kwargs={u'user': user.username})))
 else:
  return mark_safe(full_name)

def get_user_display ( user , icon = True , link = False ) : if ( user is None ) : full_name = pgettext ( u'No known user' , u'None' ) else : full_name = user . first_name if ( full_name . strip ( ) == u'' ) : full_name = user . username full_name = escape ( full_name ) if ( icon and appsettings . ENABLE_AVATARS ) : if ( ( user is None ) or ( user . email == u'noreply@weblate.org' ) ) : avatar = get_fallback_avatar_url ( 32 ) else : avatar = reverse ( u'user_avatar' , kwargs = { u'user' : user . username , u'size' : 32 } ) full_name = u'<img src="{avatar}" class="avatar" /> {name}' . format ( name = full_name , avatar = avatar ) if ( link and ( user is not None ) ) : return mark_safe ( u'<a href="{link}">{name}</a>' . format ( name = full_name , link = reverse ( u'user_page' , kwargs = { u'user' : user . username } ) ) ) else : return mark_safe ( full_name )
nicely formats user for display .