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
9c6032bf
Commit
9c6032bf
authored
Mar 08, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix invocation with None as project
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
88f93953
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
weblate/trans/permissions.py
weblate/trans/permissions.py
+4
-2
No files found.
weblate/trans/permissions.py
View file @
9c6032bf
...
@@ -47,14 +47,16 @@ def has_group_perm(user, permission, translation=None, project=None):
...
@@ -47,14 +47,16 @@ def has_group_perm(user, permission, translation=None, project=None):
Checks whether GroupACL rules allow user to have
Checks whether GroupACL rules allow user to have
given permission.
given permission.
"""
"""
if
project
is
None
:
if
translation
is
not
None
:
acls
=
list
(
GroupACL
.
objects
.
filter
(
acls
=
list
(
GroupACL
.
objects
.
filter
(
Q
(
language
=
translation
.
language
)
|
Q
(
language
=
translation
.
language
)
|
Q
(
project
=
translation
.
subproject
.
project
)
|
Q
(
project
=
translation
.
subproject
.
project
)
|
Q
(
subproject
=
translation
.
subproject
)
Q
(
subproject
=
translation
.
subproject
)
))
))
el
s
e
:
el
if
project
is
not
Non
e
:
acls
=
list
(
GroupACL
.
objects
.
filter
(
project
=
project
))
acls
=
list
(
GroupACL
.
objects
.
filter
(
project
=
project
))
else
:
return
False
if
not
acls
:
if
not
acls
:
return
user
.
has_perm
(
permission
)
return
user
.
has_perm
(
permission
)
...
...
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