Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
e25aacb3
Commit
e25aacb3
authored
Aug 05, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split out email sending from generating
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
8f919d48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
weblate/accounts/models.py
weblate/accounts/models.py
+21
-7
No files found.
weblate/accounts/models.py
View file @
e25aacb3
...
...
@@ -190,11 +190,11 @@ def notify_new_comment(unit, comment, user, report_source_bugs):
)
def
send
_notification_email
(
language
,
email
,
notification
,
translation_obj
=
None
,
context
=
None
,
headers
=
None
,
user
=
None
,
info
=
None
):
def
get
_notification_email
(
language
,
email
,
notification
,
translation_obj
=
None
,
context
=
None
,
headers
=
None
,
user
=
None
,
info
=
None
):
'''
Renders
and sends
notification email.
Renders notification email.
'''
cur_language
=
django_translation
.
get_language
()
context
=
context
or
{}
...
...
@@ -271,12 +271,26 @@ def send_notification_email(language, email, notification,
'text/html'
)
# Send it out
# Return the mail
return
email
finally
:
django_translation
.
activate
(
cur_language
)
def
send_notification_email
(
language
,
email
,
notification
,
translation_obj
=
None
,
context
=
None
,
headers
=
None
,
user
=
None
,
info
=
None
):
'''
Renders and sends notification email.
'''
try
:
email
=
get_notification_email
(
language
,
email
,
notification
,
translation_obj
,
context
,
headers
,
user
,
info
)
email
.
send
(
fail_silently
=
False
)
except
SMTPException
as
error
:
weblate
.
logger
.
error
(
'Failed to send email: %s'
,
error
)
finally
:
django_translation
.
activate
(
cur_language
)
class
VerifiedEmail
(
models
.
Model
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment