Unverified Commit f8762f2e authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Use get_full_name for str(Member)

Closes #37
parent 462720f9
...@@ -91,8 +91,8 @@ class Member(models.Model): ...@@ -91,8 +91,8 @@ class Member(models.Model):
@classmethod @classmethod
def all_with_membership(cls, membership_type, prefetch=None): def all_with_membership(cls, membership_type, prefetch=None):
return [x for x in cls.objects.all().prefetch_related(prefetch) return [x for x in cls.objects.all().prefetch_related(prefetch)
if x.current_membership if x.current_membership and
and x.current_membership.type == membership_type] x.current_membership.type == membership_type]
# ---- Address information ----- # ---- Address information -----
...@@ -271,7 +271,7 @@ class Member(models.Model): ...@@ -271,7 +271,7 @@ class Member(models.Model):
return self.user.get_full_name() return self.user.get_full_name()
def __str__(self): def __str__(self):
return self.display_name() return '{} ({})'.format(self.get_full_name(), self.username)
class Membership(models.Model): class Membership(models.Model):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment