From c4185b15ca1d9e78b436118329a6dabb1f3cf638 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 19 Jan 2023 18:07:31 +0000 Subject: [PATCH] Fix member model no user __str__ history bug --- apiserver/apiserver/api/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiserver/apiserver/api/models.py b/apiserver/apiserver/api/models.py index 0f9ac68..9cd5424 100644 --- a/apiserver/apiserver/api/models.py +++ b/apiserver/apiserver/api/models.py @@ -63,7 +63,7 @@ class Member(models.Model): MY_FIELDS = ['user', 'preferred_name', 'last_name', 'status'] def __str__(self): - return self.user.username + return getattr(self.user, 'username', 'None') class Transaction(models.Model): user = models.ForeignKey(User, related_name='transactions', blank=True, null=True, on_delete=models.SET_NULL)