diff options
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index ca4055fb2..67c4422f6 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2686,7 +2686,15 @@ class UserProfile(models.Model): verbose_name_plural = _(u"User profiles") def __unicode__(self): - return unicode(self.profile_type) + lbl = unicode(self.profile_type) + if not self.areas.count(): + return lbl + return u"{} ({})".format(lbl, u", ".join( + [unicode(area) for area in self.areas.all()])) + + @property + def area_labels(self): + return u", ".join([unicode(area) for area in self.areas.all()]) class IshtarUser(FullSearch): |