Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ssoauth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
django
ssoauth
Commits
23e86d6f
Commit
23e86d6f
authored
3 years ago
by
Art
Browse files
Options
Downloads
Patches
Plain Diff
Revert
92815998
because it breaks creation of predefined groups with django.contrib permissions
This reverts commit
92815998
.
parent
ac8e818a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ssoauth/management/commands/ssoauth_setup_groups_and_perms.py
+2
-3
2 additions, 3 deletions
...uth/management/commands/ssoauth_setup_groups_and_perms.py
with
2 additions
and
3 deletions
ssoauth/management/commands/ssoauth_setup_groups_and_perms.py
+
2
−
3
View file @
23e86d6f
...
...
@@ -16,14 +16,13 @@ def get_or_create_permission(codename, create_with_name=None):
:return: permission object
Ensures the permissions exists. Creates it if needed.
"""
user_content_type
=
get_user_content_type
()
try
:
perm
=
Permission
.
objects
.
get
(
codename
=
codename
,
content_type
=
user_content_type
)
perm
=
Permission
.
objects
.
get
(
codename
=
codename
)
except
Permission
.
DoesNotExist
:
perm
=
Permission
.
objects
.
create
(
codename
=
codename
,
name
=
create_with_name
or
codename
,
content_type
=
user_content_type
content_type
=
get_
user_content_type
()
)
logger
.
info
(
"
Created permission: {0}
"
.
format
(
perm
))
return
perm
...
...
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