@register.simple_tag(takes_context=True)
def avatar(context, user, size, service_id=None):
 service = avatar_services.for_user(user, service_id)
 if (service is None):
  logging.error(u'Could not get a suitable avatar service for user %s.', user)
  return mark_safe(u'')
 return service.render(request=context[u'request'], user=user, size=size)

@ register . simple_tag ( takes_context = True ) def avatar ( context , user , size , service_id = None ) : service = avatar_services . for_user ( user , service_id ) if ( service is None ) : logging . error ( u'Could not get a suitable avatar service for user %s.' , user ) return mark_safe ( u'' ) return service . render ( request = context [ u'request' ] , user = user , size = size )
render the users avatar to html .