diff --git a/events/admin.py b/events/admin.py index 40de86d..4b81b8d 100644 --- a/events/admin.py +++ b/events/admin.py @@ -22,7 +22,9 @@ class CityAdmin(admin.ModelAdmin): search_fields = ('name', 'spr__name') admin.site.register(City, CityAdmin) -admin.site.register(UserProfile) +class ProfileAdmin(admin.ModelAdmin): + list_display = ('user', 'realname', 'avatar', 'web_url') +admin.site.register(UserProfile, ProfileAdmin) class OrgAdmin(admin.ModelAdmin): list_display = ('name', 'site') diff --git a/events/models/profiles.py b/events/models/profiles.py index a5aaf16..219dfe0 100644 --- a/events/models/profiles.py +++ b/events/models/profiles.py @@ -100,6 +100,11 @@ def _getUserProfile(self): if created: profile.tz = get_user_timezone(self.username) + if self.first_name: + if self.last_name: + profile.realname = '%s %s' % (self.first_name, self.last_name) + else: + profile.realname = self.first_name profile.save() return profile