Fix member model no user __str__ history bug
This commit is contained in:
parent
8dcc61817f
commit
c4185b15ca
|
@ -63,7 +63,7 @@ class Member(models.Model):
|
||||||
|
|
||||||
MY_FIELDS = ['user', 'preferred_name', 'last_name', 'status']
|
MY_FIELDS = ['user', 'preferred_name', 'last_name', 'status']
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.user.username
|
return getattr(self.user, 'username', 'None')
|
||||||
|
|
||||||
class Transaction(models.Model):
|
class Transaction(models.Model):
|
||||||
user = models.ForeignKey(User, related_name='transactions', blank=True, null=True, on_delete=models.SET_NULL)
|
user = models.ForeignKey(User, related_name='transactions', blank=True, null=True, on_delete=models.SET_NULL)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user