Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djangoldp-notification
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
decentral1se
djangoldp-notification
Commits
3e9b8a59
Commit
3e9b8a59
authored
3 years ago
by
Jean-Baptiste Pasquier
Browse files
Options
Downloads
Patches
Plain Diff
fix: values on local objects
parent
de996c6a
No related branches found
Branches containing commit
Tags
v2.2.5
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
djangoldp_notification/models.py
+2
-2
2 additions, 2 deletions
djangoldp_notification/models.py
with
2 additions
and
2 deletions
djangoldp_notification/models.py
+
2
−
2
View file @
3e9b8a59
...
...
@@ -210,7 +210,7 @@ def send_email_on_notification(sender, instance, created, **kwargs):
try
:
# local author
if
instance
.
author
.
startswith
(
settings
.
SITE_URL
):
who
=
str
(
Model
.
resolve_id
(
instance
.
author
.
replace
(
settings
.
SITE_URL
,
''
)))
who
=
str
(
Model
.
resolve_id
(
instance
.
author
.
replace
(
settings
.
SITE_URL
,
''
))
.
get_full_name
()
)
# external author
else
:
who
=
requests
.
get
(
instance
.
author
).
json
()[
'
name
'
]
...
...
@@ -220,7 +220,7 @@ def send_email_on_notification(sender, instance, created, **kwargs):
# get identifier for resource triggering notification, and store in where
try
:
if
instance
.
object
.
startswith
(
settings
.
SITE_URL
):
where
=
str
(
Model
.
resolve_id
(
instance
.
object
.
replace
(
settings
.
SITE_URL
,
''
)))
where
=
str
(
Model
.
resolve_id
(
instance
.
object
.
replace
(
settings
.
SITE_URL
,
''
))
.
name
)
else
:
where
=
requests
.
get
(
instance
.
object
).
json
()[
'
name
'
]
except
:
...
...
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