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
7a726ea7
Commit
7a726ea7
authored
Mar 30, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let project owner receive merge failures
Issue #636 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
376fc38f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
weblate/accounts/models.py
weblate/accounts/models.py
+7
-0
weblate/accounts/tests.py
weblate/accounts/tests.py
+14
-1
No files found.
weblate/accounts/models.py
View file @
7a726ea7
...
...
@@ -50,8 +50,15 @@ def notify_merge_failure(subproject, error, status):
subscriptions
=
Profile
.
objects
.
subscribed_merge_failure
(
subproject
.
project
,
)
users
=
set
()
for
subscription
in
subscriptions
:
subscription
.
notify_merge_failure
(
subproject
,
error
,
status
)
users
.
add
(
subscription
.
user_id
)
if
subproject
.
project
.
owner
and
subproject
.
project
.
owner_id
not
in
users
:
subproject
.
project
.
owner
.
profile
.
notify_merge_failure
(
subproject
,
error
,
status
)
# Notify admins
send_notification_email
(
...
...
weblate/accounts/tests.py
View file @
7a726ea7
...
...
@@ -425,10 +425,12 @@ class NotificationTest(ViewTestCase):
profile
.
save
()
def
second_user
(
self
):
return
User
.
objects
.
create_user
(
user
=
User
.
objects
.
create_user
(
username
=
'seconduser'
,
password
=
'secondpassword'
)
Profile
.
objects
.
create
(
user
=
user
)
return
user
def
test_notify_merge_failure
(
self
):
notify_merge_failure
(
...
...
@@ -444,6 +446,17 @@ class NotificationTest(ViewTestCase):
'[Weblate] Merge failure in Test/Test'
)
# Add project owner
self
.
subproject
.
project
.
owner
=
self
.
second_user
()
notify_merge_failure
(
self
.
subproject
,
'Failed merge'
,
'Error
\
n
status'
)
# Check mail (second one is for admin)
self
.
assertEqual
(
len
(
mail
.
outbox
),
5
)
def
test_notify_new_string
(
self
):
notify_new_string
(
self
.
get_translation
())
...
...
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