Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
3fbbe57c
Commit
3fbbe57c
authored
Sep 23, 2014
by
Julia Hansbrough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add auto-registration to third party login flow
parent
5b3c69bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
common/djangoapps/third_party_auth/pipeline.py
+18
-4
No files found.
common/djangoapps/third_party_auth/pipeline.py
View file @
3fbbe57c
...
...
@@ -69,6 +69,9 @@ from social.apps.django_app.default import models
from
social.exceptions
import
AuthException
from
social.pipeline
import
partial
from
student.models
import
CourseEnrollment
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
.
import
provider
...
...
@@ -369,6 +372,7 @@ def redirect_to_supplementary_form(strategy, details, response, uid, is_dashboar
@partial.partial
def
login_analytics
(
*
args
,
**
kwargs
):
""" Sends login info to Segment.io """
event_name
=
None
action_to_event_name
=
{
...
...
@@ -402,7 +406,17 @@ def login_analytics(*args, **kwargs):
@partial.partial
def
change_enrollment
(
*
args
,
**
kwargs
):
try
:
CourseEnrollment
.
enroll
(
user
,
'foo'
)
except
:
pass
"""
If the user accessed the third party auth flow after trying to register for
a course, we automatically log them into that course.
"""
if
kwargs
[
'strategy'
]
.
session_get
(
'registration_course_id'
):
try
:
CourseEnrollment
.
enroll
(
kwargs
[
'user'
],
SlashSeparatedCourseKey
.
from_deprecated_string
(
kwargs
[
'strategy'
]
.
session_get
(
'registration_course_id'
)
)
)
except
:
pass
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