Commit e67bc4d400fa97a325cf61c42a11fbc0fa8c80aa

Authored by Luan
1 parent a0df5ab1

adding a fullname property to messages

Showing 1 changed file with 5 additions and 4 deletions   Show diff stats
src/super_archives/models.py
@@ -326,10 +326,7 @@ class Message(models.Model): @@ -326,10 +326,7 @@ class Message(models.Model):
326 326
327 @property 327 @property
328 def author(self): 328 def author(self):
329 - from_address = self.from_address  
330 - if from_address.user:  
331 - return from_address.user.username  
332 - return None 329 + return self.fullname
333 330
334 @property 331 @property
335 def author_url(self): 332 def author_url(self):
@@ -338,6 +335,10 @@ class Message(models.Model): @@ -338,6 +335,10 @@ class Message(models.Model):
338 return None 335 return None
339 336
340 @property 337 @property
  338 + def fullname(self):
  339 + return self.from_address.get_full_name()
  340 +
  341 + @property
341 def icon_name(self): 342 def icon_name(self):
342 return u'envelope' 343 return u'envelope'
343 344