Skip to content

Commit

Permalink
Use employee.user.email() instead of constructing it
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Brennan committed Feb 16, 2017
1 parent fc39da7 commit 56683df
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions models/employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ def update_from_dict(self, d):

def get_gravatar(self):
"""Creates gravatar URL from email address."""
email = '{user}@{domain}'.format(user=self.username, domain=config.DOMAIN)
m = hashlib.md5()
m.update(email)
m.update(self.user.email())
encoded_hash = base64.b16encode(m.digest()).lower()
return '//gravatar.com/avatar/{}?s=200'.format(encoded_hash)

Expand Down

0 comments on commit 56683df

Please sign in to comment.