Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
59841cc4
Commit
59841cc4
authored
5 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
rework user-models fullname to have also a variant for letters, emails and stuff
parent
f8de697c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!117
Resolve "Use or create external library for template mailer"
Pipeline
#624
failed
5 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/models.py
+6
-2
6 additions, 2 deletions
aleksis/core/models.py
with
6 additions
and
2 deletions
aleksis/core/models.py
+
6
−
2
View file @
59841cc4
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment