Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PEDASI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
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
Research Software Group
PEDASI
Commits
c3757f5f
Commit
c3757f5f
authored
6 years ago
by
James Graham
Browse files
Options
Downloads
Patches
Plain Diff
Re-enable functionality to start new user accounts as disabled
parent
96206136
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
pedasi/settings.py
+2
-2
2 additions, 2 deletions
pedasi/settings.py
profiles/social_auth.py
+11
-0
11 additions, 0 deletions
profiles/social_auth.py
with
13 additions
and
2 deletions
pedasi/settings.py
+
2
−
2
View file @
c3757f5f
...
...
@@ -231,8 +231,8 @@ SOCIAL_AUTH_PIPELINE = [
# 'social_core.pipeline.social_auth.associate_by_email',
# Create a user account if we haven't found one yet.
'
social_core.pipeline.user.create_user
'
,
#
'profiles.social_auth.create_user_disabled',
#
'social_core.pipeline.user.create_user',
'
profiles.social_auth.create_user_disabled
'
,
# Create the record that associates the social account with the user.
'
social_core.pipeline.social_auth.associate_user
'
,
...
...
This diff is collapsed.
Click to expand it.
profiles/social_auth.py
+
11
−
0
View file @
c3757f5f
"""
Module containing customisations to the Python Social Auth pipeline.
See https://python-social-auth.readthedocs.io/en/latest/
"""
from
social_core.pipeline.user
import
create_user
def
create_user_disabled
(
strategy
,
details
,
backend
,
user
=
None
,
*
args
,
**
kwargs
):
"""
Create a user account for the user being authenticated - but mark it as disabled.
A new user must have their account enabled by an admin before they are able to log in.
"""
# Returns dict containing 'is_new' and 'user'
result
=
create_user
(
strategy
,
details
,
backend
,
user
,
*
args
,
**
kwargs
)
...
...
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