Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
ots
hypha
Commits
f06b06b6
Commit
f06b06b6
authored
5 years ago
by
Parbhat Puri
Browse files
Options
Downloads
Patches
Plain Diff
Log exception if not able to get from_address and set it to None
parent
cd804b88
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
opentech/apply/activity/messaging.py
+9
-5
9 additions, 5 deletions
opentech/apply/activity/messaging.py
with
9 additions
and
5 deletions
opentech/apply/activity/messaging.py
+
9
−
5
View file @
f06b06b6
import
json
import
json
import
requests
import
requests
import
logging
from
collections
import
defaultdict
from
collections
import
defaultdict
from
django.db
import
models
from
django.db
import
models
...
@@ -13,7 +14,7 @@ from .models import TEAM, ALL
...
@@ -13,7 +14,7 @@ from .models import TEAM, ALL
from
.options
import
MESSAGES
from
.options
import
MESSAGES
from
.tasks
import
send_mail
from
.tasks
import
send_mail
logger
=
logging
.
getLogger
(
__name__
)
User
=
get_user_model
()
User
=
get_user_model
()
...
@@ -773,11 +774,14 @@ class EmailAdapter(AdapterBase):
...
@@ -773,11 +774,14 @@ class EmailAdapter(AdapterBase):
def
send_message
(
self
,
message
,
source
,
subject
,
recipient
,
logs
,
**
kwargs
):
def
send_message
(
self
,
message
,
source
,
subject
,
recipient
,
logs
,
**
kwargs
):
try
:
try
:
try
:
from_email
=
source
.
page
.
specific
.
from_address
from_email
=
source
.
page
.
specific
.
from_address
except
AttributeError
:
# we're dealing with a project
except
AttributeError
:
# we're dealing with a project
from_email
=
source
.
submission
.
page
.
specific
.
from_address
from_email
=
source
.
submission
.
page
.
specific
.
from_address
except
Exception
as
e
:
from_address
=
None
logger
.
exception
(
e
)
try
:
send_mail
(
send_mail
(
subject
,
subject
,
message
,
message
,
...
...
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