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
98c088e8
Commit
98c088e8
authored
Jan 18, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap some long lines
parent
1421335b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
8 deletions
+40
-8
weblate/accounts/models.py
weblate/accounts/models.py
+40
-8
No files found.
weblate/accounts/models.py
View file @
98c088e8
...
...
@@ -57,7 +57,12 @@ def send_notification_email(language, email, notification, translation_obj,
if
headers
is
None
:
headers
=
{}
try
:
logger
.
info
(
'sending notification %s on %s to %s'
,
notification
,
translation_obj
.
__unicode__
(),
email
)
logger
.
info
(
'sending notification %s on %s to %s'
,
notification
,
translation_obj
.
__unicode__
(),
email
)
# Load user language
translation
.
activate
(
language
)
...
...
@@ -71,7 +76,9 @@ def send_notification_email(language, email, notification, translation_obj,
domain
=
Site
.
objects
.
get_current
().
domain
context
[
'translation'
]
=
translation_obj
context
[
'current_site'
]
=
domain
context
[
'translation_url'
]
=
'http://%s%s'
%
(
domain
,
translation_obj
.
get_absolute_url
())
context
[
'translation_url'
]
=
'http://%s%s'
%
(
domain
,
translation_obj
.
get_absolute_url
()
)
context
[
'subject_template'
]
=
subject_template
# Render subject
...
...
@@ -119,23 +126,48 @@ class ProfileManager(models.Manager):
Manager providing shortcuts for subscription queries.
'''
def
subscribed_any_translation
(
self
,
project
,
language
,
user
):
return
self
.
filter
(
subscribe_any_translation
=
True
,
subscriptions
=
project
,
languages
=
language
).
exclude
(
user
=
user
)
return
self
.
filter
(
subscribe_any_translation
=
True
,
subscriptions
=
project
,
languages
=
language
).
exclude
(
user
=
user
)
def
subscribed_new_string
(
self
,
project
,
language
):
return
self
.
filter
(
subscribe_new_string
=
True
,
subscriptions
=
project
,
languages
=
language
)
return
self
.
filter
(
subscribe_new_string
=
True
,
subscriptions
=
project
,
languages
=
language
)
def
subscribed_new_suggestion
(
self
,
project
,
language
,
user
):
ret
=
self
.
filter
(
subscribe_new_suggestion
=
True
,
subscriptions
=
project
,
languages
=
language
)
ret
=
self
.
filter
(
subscribe_new_suggestion
=
True
,
subscriptions
=
project
,
languages
=
language
)
# We don't want to filter out anonymous user
if
user
.
is_authenticated
():
ret
=
ret
.
exclude
(
user
=
user
)
return
ret
def
subscribed_new_contributor
(
self
,
project
,
language
,
user
):
return
self
.
filter
(
subscribe_new_contributor
=
True
,
subscriptions
=
project
,
languages
=
language
).
exclude
(
user
=
user
)
return
self
.
filter
(
subscribe_new_contributor
=
True
,
subscriptions
=
project
,
languages
=
language
).
exclude
(
user
=
user
)
def
subscribed_new_comment
(
self
,
project
,
language
,
user
):
ret
=
self
.
filter
(
subscribe_new_comment
=
True
,
subscriptions
=
project
).
exclude
(
user
=
user
)
ret
=
self
.
filter
(
subscribe_new_comment
=
True
,
subscriptions
=
project
).
exclude
(
user
=
user
)
# Source comments go to every subscriber
if
language
is
not
None
:
ret
=
ret
.
filter
(
languages
=
language
)
...
...
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