diff --git a/events/models/profiles.py b/events/models/profiles.py index 219dfe0..ac3b921 100644 --- a/events/models/profiles.py +++ b/events/models/profiles.py @@ -7,6 +7,7 @@ from .locale import * import pytz import datetime +import hashlib class UserProfile(models.Model): " Store profile information about a user " @@ -105,6 +106,12 @@ def _getUserProfile(self): profile.realname = '%s %s' % (self.first_name, self.last_name) else: profile.realname = self.first_name + + if self.email: + h = hashlib.md5() + h.update(bytearray(profile.user.email, 'utf8')) + profile.avatar = 'http://www.gravatar.com/avatar/%s.jpg?d=mm' % h.hexdigest() + profile.save() return profile diff --git a/get_together/templates/get_together/events/show_event.html b/get_together/templates/get_together/events/show_event.html index 43ca213..a9f23e0 100644 --- a/get_together/templates/get_together/events/show_event.html +++ b/get_together/templates/get_together/events/show_event.html @@ -37,13 +37,14 @@
- {{ attendee.user }} +
- {{member.user}} +