old_contents: from django.conf import settings
  from django import template
  from gravatar import Gravatar
  from sorl.thumbnail import get_thumbnail
  
  register = template.Library()
  
  AVATAR_DEFAULT = getattr(settings, 'USER_AVATAR_DEFAULT', 'retro')
  AVATAR_SSL = getattr(settings, 'USER_AVATAR_SSL', True)
  
  
  @register.simple_tag
  def get_avatar_url(user, width=80, height=80, default=None):
      if user.picture:
          return get_thumbnail(user.picture, "{width}x{height}".format(width=width, height=height))
      return Gravatar(email=user.email,
                      secure=AVATAR_SSL,
                      width=width,
                      default=default or AVATAR_DEFAULT).thumb
  
new_contents: from django.conf import settings
  from django import template
  from gravatar import Gravatar
  from sorl.thumbnail import get_thumbnail
  
  register = template.Library()
  
  AVATAR_DEFAULT = getattr(settings, 'USER_AVATAR_DEFAULT', 'retro')
  AVATAR_SSL = getattr(settings, 'USER_AVATAR_SSL', True)
  
  
  @register.simple_tag
  def get_avatar_url(user, width=80, height=80, default=None):
      if user.picture:
          return get_thumbnail(user.picture, "{width}x{height}".format(width=width, height=height))
      return Gravatar(email=user.email,
                      secure=AVATAR_SSL,
                      size=width,
                      default=default or AVATAR_DEFAULT).thumb
  
subject: Fix users_tags for gravatar