diff --git a/src/pictures/models.py b/src/pictures/models.py index 5d22c95..e6c275a 100644 --- a/src/pictures/models.py +++ b/src/pictures/models.py @@ -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): diff --git a/src/pictures/templates/pictures/messages-detail.html b/src/pictures/templates/pictures/messages-detail.html index af11990..546149f 100644 --- a/src/pictures/templates/pictures/messages-detail.html +++ b/src/pictures/templates/pictures/messages-detail.html @@ -13,7 +13,7 @@ {% block content %}
-
De: {{ message.sender.display_name }}
+
De: {{ message.sender }}
{{ message.received_at }}
diff --git a/src/pictures/templates/pictures/messages-list.html b/src/pictures/templates/pictures/messages-list.html index b53db1e..fef66b1 100644 --- a/src/pictures/templates/pictures/messages-list.html +++ b/src/pictures/templates/pictures/messages-list.html @@ -17,7 +17,7 @@

{{ message.content | linebreaks }}