Skip to content

Commit

Permalink
return unk avatar for gravatar
Browse files Browse the repository at this point in the history
  • Loading branch information
leduythuccs authored and hieplpvip committed Aug 1, 2024
1 parent 714a072 commit bb068bd
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions judge/jinja2/gravatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,4 @@

@registry.function
def gravatar(email, size=80, default=None):
if isinstance(email, Profile):
if default is None:
default = email.mute
email = email.user.email
elif isinstance(email, AbstractUser):
email = email.email

gravatar_url = 'https://www.gravatar.com/avatar/' + hashlib.md5(utf8bytes(email.strip().lower())).hexdigest() + '?'
args = {'d': 'identicon', 's': str(size)}
if default:
args['f'] = 'y'
gravatar_url += urlencode(args)
return gravatar_url
return '/martor/logo/unk.png'

0 comments on commit bb068bd

Please sign in to comment.