Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
e68cbf3c
Commit
e68cbf3c
authored
4 years ago
by
Valentin Rigal
Browse files
Options
Downloads
Patches
Plain Diff
Rebase
parent
2444ae5f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arkindex/users/serializers.py
+2
-2
2 additions, 2 deletions
arkindex/users/serializers.py
arkindex/users/tests/test_membership.py
+2
-2
2 additions, 2 deletions
arkindex/users/tests/test_membership.py
with
4 additions
and
4 deletions
arkindex/users/serializers.py
+
2
−
2
View file @
e68cbf3c
...
...
@@ -267,10 +267,10 @@ class GroupSerializer(SimpleGroupSerializer):
def
create
(
self
,
validated_data
):
group
=
super
().
create
(
validated_data
)
# Associate the creator to the group
group
.
add_member
(
self
.
context
[
'
request
'
].
user
,
Group
.
ADMIN_LEVEL
)
group
.
add_member
(
self
.
context
[
'
request
'
].
user
,
Role
.
Admin
.
value
)
# Manually set fields required by the serializer
group
.
members_count
=
1
group
.
level
=
Group
.
ADMIN_LEVEL
group
.
level
=
Role
.
Admin
.
value
return
group
...
...
This diff is collapsed.
Click to expand it.
arkindex/users/tests/test_membership.py
+
2
−
2
View file @
e68cbf3c
...
...
@@ -149,7 +149,7 @@ class TestMembership(FixtureAPITestCase):
'
members_count
'
:
3
,
'
name
'
:
self
.
group
.
name
,
'
public
'
:
self
.
group
.
public
,
'
level
'
:
Group
.
ADMIN_LEVEL
'
level
'
:
Role
.
Admin
.
value
})
def
test_update_group_no_admin
(
self
):
...
...
@@ -187,7 +187,7 @@ class TestMembership(FixtureAPITestCase):
'
members_count
'
:
3
,
'
name
'
:
'
Renamed group
'
,
'
public
'
:
True
,
'
level
'
:
Group
.
ADMIN_LEVEL
'
level
'
:
Role
.
Admin
.
value
})
def
test_delete_group_no_admin
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment