Skip to content

Commit

Permalink
Templates: remove unused filter (#11504)
Browse files Browse the repository at this point in the history
We are using django-gravatar2 for gravatar support.
Also, this filter is wrong, if used, this renders the HTML as text.
  • Loading branch information
stsewd authored Jul 29, 2024
1 parent 6528d5d commit c99de36
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions readthedocs/core/templatetags/core_tags.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""Template tags for core app."""

import hashlib
import json
from urllib.parse import urlencode

from django import template
from django.core.serializers.json import DjangoJSONEncoder
Expand All @@ -15,26 +13,6 @@
register = template.Library()


@register.filter
def gravatar(email, size=48):
"""
Hacked from djangosnippets.org, but basically given an email address.
render an img tag with the hashed up bits needed for leetness
omgwtfstillreading
"""
url = "http://www.gravatar.com/avatar.php?%s" % urlencode(
{
"gravatar_id": hashlib.md5(email).hexdigest(),
"size": str(size),
}
)
return (
'<img src="%s" width="%s" height="%s" alt="gravatar" '
'class="gravatar" border="0" />' % (url, size, size)
)


@register.simple_tag(name="doc_url")
def make_document_url(project, version=None, page="", path=""):
"""
Expand Down

0 comments on commit c99de36

Please sign in to comment.