Fix unknown contact display

This commit is contained in:
Gabriel Augendre 2021-02-14 19:17:26 +01:00
parent 567b2689a1
commit 4e170074b7
3 changed files with 3 additions and 3 deletions

View file

@ -16,7 +16,7 @@ class Contact(models.Model):
display_name = models.CharField(max_length=250, blank=True)
def __str__(self):
return self.display_name or self.phone_number
return self.display_name or str(self.phone_number)
class Message(models.Model):

View file

@ -13,7 +13,7 @@
{% block content %}
<div class="message">
<div class="metadata">
<div class="name">De: {{ message.sender.display_name }}</div>
<div class="name">De: {{ message.sender }}</div>
<div class="date">{{ message.received_at }}</div>
</div>
<div class="media">

View file

@ -17,7 +17,7 @@
</div>
<div class="content-block">
<div class="metadata">
<div class="name">De: {{ message.sender.display_name }}</div>
<div class="name">De: {{ message.sender }}</div>
<div class="date">{{ message.received_at }}</div>
</div>
<p class="text">{{ message.content | linebreaks }}</p>