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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
django
ssoauth
Commits
f1613217
Commit
f1613217
authored
7 years ago
by
schulmax
Browse files
Options
Downloads
Patches
Plain Diff
Make DevBackend dev again
parent
889dac69
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ssoauth/auth_utils.py
+2
-2
2 additions, 2 deletions
ssoauth/auth_utils.py
ssoauth/views.py
+1
-1
1 addition, 1 deletion
ssoauth/views.py
with
3 additions
and
3 deletions
ssoauth/auth_utils.py
+
2
−
2
View file @
f1613217
...
@@ -136,7 +136,7 @@ def cleanup_direct_permissions(user):
...
@@ -136,7 +136,7 @@ def cleanup_direct_permissions(user):
user
.
user_permissions
.
clear
()
user
.
user_permissions
.
clear
()
def
set_user_compat_flags
(
user
):
def
set_user_compat_flags
(
user
,
check_login_perm
=
True
):
def
get_full_perm_name
(
codename
):
def
get_full_perm_name
(
codename
):
return
"
{app}.{codename}
"
.
format
(
return
"
{app}.{codename}
"
.
format
(
...
@@ -162,7 +162,7 @@ def set_user_compat_flags(user):
...
@@ -162,7 +162,7 @@ def set_user_compat_flags(user):
logger
.
info
(
"
User {user} is staff (has admin access).
"
.
format
(
**
locals
()))
logger
.
info
(
"
User {user} is staff (has admin access).
"
.
format
(
**
locals
()))
user
.
is_staff
=
True
user
.
is_staff
=
True
# is_active (actually represents the log in permission)
# is_active (actually represents the log in permission)
if
app_settings
.
LOGIN_PERM_CODENAME
:
if
app_settings
.
LOGIN_PERM_CODENAME
and
check_login_perm
:
if
user
.
has_perm
(
get_full_perm_name
(
app_settings
.
LOGIN_PERM_CODENAME
)):
if
user
.
has_perm
(
get_full_perm_name
(
app_settings
.
LOGIN_PERM_CODENAME
)):
logger
.
info
(
"
User {user} is active.
"
.
format
(
**
locals
()))
logger
.
info
(
"
User {user} is active.
"
.
format
(
**
locals
()))
user
.
is_active
=
True
user
.
is_active
=
True
...
...
This diff is collapsed.
Click to expand it.
ssoauth/views.py
+
1
−
1
View file @
f1613217
...
@@ -350,7 +350,7 @@ class DevView(FormView):
...
@@ -350,7 +350,7 @@ class DevView(FormView):
contrib_auth
.
logout
(
self
.
request
)
contrib_auth
.
logout
(
self
.
request
)
# update the compat flags, might be needed when user or their groups change
# update the compat flags, might be needed when user or their groups change
if
self
.
request
.
user
.
is_authenticated
:
if
self
.
request
.
user
.
is_authenticated
:
auth_utils
.
set_user_compat_flags
(
self
.
request
.
user
)
auth_utils
.
set_user_compat_flags
(
self
.
request
.
user
,
False
)
# redirect
# redirect
return
http
.
HttpResponseRedirect
(
self
.
next_url
or
urls
.
reverse
(
"
sso-dev
"
))
return
http
.
HttpResponseRedirect
(
self
.
next_url
or
urls
.
reverse
(
"
sso-dev
"
))
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