Skip to content
Snippets Groups Projects
Commit 59841cc4 authored by Julian's avatar Julian
Browse files

rework user-models fullname to have also a variant for letters, emails and stuff

parent f8de697c
No related branches found
No related tags found
1 merge request!117Resolve "Use or create external library for template mailer"
Pipeline #624 failed
......@@ -144,7 +144,11 @@ class Person(models.Model, ExtensibleModel):
@property
def full_name(self) -> str:
return "%s, %s" % (self.last_name, self.first_name)
return f"{self.last_name}, {self.first_name}"
@property
def adressing_name(self) -> str:
return f"{self.first_name} {self.last_name}"
def __str__(self) -> str:
return self.full_name
......@@ -216,7 +220,7 @@ class Notification(models.Model):
if not self.mailed:
context = self.__dict__
context["notification_user"] = " ".join([self.user.first_name, self.user.last_name])
context["notification_user"] = self.user.adressing_name
send_templated_mail(
template_name='notification',
from_email=config.MAIL_OUT,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment