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
6a4d3227
Commit
6a4d3227
authored
Jan 18, 2016
by
matejcik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add __str__ for GroupACL
parent
f8947890
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
weblate/trans/models/group_acl.py
weblate/trans/models/group_acl.py
+15
-0
weblate/trans/tests/test_permissions.py
weblate/trans/tests/test_permissions.py
+0
-1
No files found.
weblate/trans/models/group_acl.py
View file @
6a4d3227
...
...
@@ -22,12 +22,14 @@
from
django.db
import
models
from
django.core.exceptions
import
ValidationError
from
django.utils.encoding
import
python_2_unicode_compatible
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.contrib.auth.models
import
Group
from
weblate.lang.models
import
Language
@
python_2_unicode_compatible
class
GroupACL
(
models
.
Model
):
groups
=
models
.
ManyToManyField
(
Group
)
...
...
@@ -47,6 +49,19 @@ class GroupACL(models.Model):
if
self
.
project
and
self
.
subproject
:
self
.
project
=
None
def
__str__
(
self
):
params
=
[]
if
self
.
language
:
params
.
append
(
"language={}"
.
format
(
self
.
language
))
if
self
.
subproject
:
params
.
append
(
"project={}"
.
format
(
self
.
subproject
))
elif
self
.
project
:
params
.
append
(
"project={}"
.
format
(
self
.
project
))
if
not
params
:
# in case the object is not valid
params
.
append
(
"(unspecified)"
)
return
"<GroupACL({}) for {}>"
.
format
(
self
.
pk
,
", "
.
join
(
params
))
class
Meta
(
object
):
unique_together
=
(
'project'
,
'subproject'
,
'language'
)
verbose_name
=
_
(
'Group ACL'
)
...
...
weblate/trans/tests/test_permissions.py
View file @
6a4d3227
...
...
@@ -131,4 +131,3 @@ class GroupACLTest(ModelTestCase):
acl_sub
.
groups
.
add
(
self
.
group
)
self
.
assertTrue
(
can_edit
(
self
.
privileged
,
self
.
trans
,
self
.
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