Commit ff3211a1 authored by Bram in 't Zandt's avatar Bram in 't Zandt

Users without a membership are now marked as Unknown

parent 6b5cb6f4
This diff was suppressed by a .gitattributes entry.
......@@ -113,6 +113,12 @@ class Member(models.Model):
def membership_set(self):
return self.user.membership_set
def has_been_member(self):
return self.membership_set.filter(type='member').count() > 0
def has_been_honorary_member(self):
return self.membership_set.filter(type='honorary').count() > 0
def is_active(self):
"""Is this member currently active
......
......@@ -122,9 +122,16 @@ def profile(request, pk=None):
achievements = member_achievements(member)
membership = member.current_membership
membership_type = _("Former member")
membership_type = _("Unknown membership history")
if membership:
membership_type = membership.get_type_display()
elif member.has_been_honorary_member():
membership_type = _("Former honorary member")
elif member.has_been_member():
membership_type = _("Former member")
elif member.latest_membership:
membership_type = _("Former supporter")
return render(request, 'members/profile.html',
{
'achievements': achievements,
......
Markdown is supported
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