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
ab08da28
Commit
ab08da28
authored
Aug 10, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust code to multiple owners situation
Issue #719 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
180bab94
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
8 deletions
+9
-8
weblate/accounts/models.py
weblate/accounts/models.py
+4
-4
weblate/accounts/tests.py
weblate/accounts/tests.py
+2
-2
weblate/trans/permissions.py
weblate/trans/permissions.py
+1
-1
weblate/trans/tests/test_permissions.py
weblate/trans/tests/test_permissions.py
+2
-1
No files found.
weblate/accounts/models.py
View file @
ab08da28
...
...
@@ -70,9 +70,9 @@ def notify_merge_failure(subproject, error, status):
)
users
.
add
(
subscription
.
user_id
)
if
subproject
.
project
.
owner
and
subproject
.
project
.
owner_id
not
in
users
:
for
owner
in
subproject
.
project
.
owners
.
all
()
:
mails
.
append
(
subproject
.
project
.
owner
.
profile
.
notify_merge_failure
(
owner
.
profile
.
notify_merge_failure
(
subproject
,
error
,
status
)
)
...
...
@@ -126,9 +126,9 @@ def notify_new_language(subproject, language, user):
)
users
.
add
(
subscription
.
user_id
)
if
subproject
.
project
.
owner
and
subproject
.
project
.
owner_id
not
in
users
:
for
owner
in
subproject
.
project
.
owners
.
all
()
:
mails
.
append
(
subproject
.
project
.
owner
.
profile
.
notify_new_language
(
owner
.
profile
.
notify_new_language
(
subproject
,
language
,
user
)
)
...
...
weblate/accounts/tests.py
View file @
ab08da28
...
...
@@ -566,7 +566,7 @@ class NotificationTest(ViewTestCase):
)
# Add project owner
self
.
subproject
.
project
.
owner
=
self
.
second_user
(
)
self
.
subproject
.
project
.
owner
s
.
add
(
self
.
second_user
()
)
notify_merge_failure
(
self
.
subproject
,
'Failed merge'
,
...
...
@@ -620,7 +620,7 @@ class NotificationTest(ViewTestCase):
)
# Add project owner
self
.
subproject
.
project
.
owner
=
second_user
self
.
subproject
.
project
.
owner
s
.
add
(
second_user
)
notify_new_language
(
self
.
subproject
,
Language
.
objects
.
filter
(
code
=
'de'
),
...
...
weblate/trans/permissions.py
View file @
ab08da28
...
...
@@ -28,7 +28,7 @@ def check_owner(user, project, permission):
"""
Checks whether owner group has given permission.
"""
if
user
!=
project
.
owner
:
if
not
project
.
owners
.
filter
(
id
=
user
.
id
).
exists
()
:
return
False
group
=
Group
.
objects
.
get
(
name
=
'Owners'
)
app
,
perm
=
permission
.
split
(
'.'
)
...
...
weblate/trans/tests/test_permissions.py
View file @
ab08da28
...
...
@@ -31,7 +31,8 @@ class PermissionsTest(TestCase):
self
.
user
=
User
.
objects
.
create_user
(
'user'
,
'test@example.com'
,
'x'
)
self
.
owner
=
User
.
objects
.
create_user
(
'owner'
,
'test@example.com'
,
'x'
)
self
.
owner
.
groups
.
add
(
Group
.
objects
.
get
(
name
=
'Owners'
))
self
.
project
=
Project
.
objects
.
create
(
slug
=
'test'
,
owner
=
self
.
owner
)
self
.
project
=
Project
.
objects
.
create
(
slug
=
'test'
)
self
.
project
.
owners
.
add
(
self
.
owner
)
def
test_owner_owned
(
self
):
self
.
assertTrue
(
...
...
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