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

Add __str__ methods to the member models

This makes the admin clearer in many places.
parent 8bcdc918
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-19 15:27+0200\n"
"PO-Revision-Date: 2018-08-19 15:27+0200\n"
"POT-Creation-Date: 2018-08-31 17:06+0200\n"
"PO-Revision-Date: 2018-08-31 17:10+0200\n"
"Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n"
"Language-Team: \n"
"Language: nl\n"
......@@ -364,6 +364,10 @@ msgstr ""
msgid "A birthday cannot be in the future."
msgstr "Een verjaardag kan niet in de toekomst liggen."
#: models.py
msgid "Profile for {}"
msgstr "Profiel voor {}"
#: models.py
msgid "Member"
msgstr "Lid"
......@@ -400,6 +404,15 @@ msgstr "Lid tot"
msgid "The date the member stops holding this membership."
msgstr "De datum waarop het lid dit lidmaatschap beëindigd."
#: models.py
msgid "Membership of type {} for {} ({}) starting {}"
msgstr "Lidmaatschap van type {} van {} ({}) gestart {}"
#: models.py
msgctxt "Membership until x"
msgid " until {}"
msgstr " tot {}"
#: models.py
msgid "End date can't be before start date"
msgstr "De einddatum kan niet eerder zijn dan de startdatum"
......@@ -436,6 +449,14 @@ msgstr "bevestigd"
msgid "the old email address was checked"
msgstr "het oude e-mailadres is gecontroleerd"
#: models.py
msgid ""
"Email change request for {} to {} created at {} (confirmed: {}, verified: "
"{})."
msgstr ""
"E-mail wijzigingsverzoek voor {} naar {} gemaakt op {} (bevestigd: {}, "
"geverifieerd: {})."
#: models.py
msgid "Please enter a new email address."
msgstr "Vul een nieuw e-mailadres in."
......
......@@ -12,7 +12,7 @@ from django.db import models
from django.db.models import Q
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import pgettext_lazy, gettext_lazy as _
from functools import reduce
from localflavor.generic.countries.sepa import IBAN_SEPA_COUNTRIES
from localflavor.generic.models import IBANField
......@@ -470,7 +470,7 @@ class Profile(models.Model):
logging.warning("We already had this image")
def __str__(self):
return str(self.user)
return _("Profile for {}").format(self.user)
class Membership(models.Model):
......@@ -509,6 +509,16 @@ class Membership(models.Model):
null=True,
)
def __str__(self):
s = _("Membership of type {} for {} ({}) starting {}").format(
self.get_type_display(), self.user.get_full_name(),
self.user.username, self.since,
)
if self.until is not None:
s += pgettext_lazy("Membership until x", " until {}").format(
self.until)
return s
def clean(self):
super().clean()
......@@ -566,6 +576,16 @@ class EmailChange(models.Model):
help_text=_('the old email address was checked')
)
def __str__(self):
return _(
"Email change request for {} to {} "
"created at {} "
"(confirmed: {}, verified: {})."
).format(
self.member, self.email, self.created_at, self.confirmed,
self.verified
)
@property
def completed(self):
return self.verified and self.confirmed
......
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