From 07f25cfbccd59d8c6b57b3487b2083cfa03cceae Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 19 Apr 2018 11:44:30 +0200 Subject: Account wizard: edit areas (refs #4060) --- ishtar_common/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ishtar_common/models.py') 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): -- cgit v1.2.3