Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiles creation #91

Merged
merged 1 commit into from
Mar 24, 2016
Merged

Profiles creation #91

merged 1 commit into from
Mar 24, 2016

Conversation

giocalitri
Copy link
Contributor

What are the relevant tickets?

fixes #73

What's this PR do?

Creates a Profile for the user and populates it with the data existing in the connected EDX instance

Where should the reviewer start?

pipeline_api.py

How should this be manually tested?

Add some personal info for your user on edx and then login again on micromasters.
The user should be new on micromasters otherwise the profile will not be updated with the info from edx

Any background context you want to provide?

you need a working micromasters properly configured with a local instance of EDX

What GIF best describes this PR or how it makes you feel?

@bdero bdero deployed to micromasters-ci-pr-91 March 21, 2016 22:18 Active
@bdero bdero deployed to micromasters-ci-pr-91 March 21, 2016 22:39 Active
@noisecapella noisecapella self-assigned this Mar 23, 2016

def update_profile_from_edx(backend, user, response, is_new, *args, **kwargs): # pylint: disable=unused-argument
"""
Gets profile informations from EDX and saves them in the user profile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

information not informations.

@justinabrahms
Copy link
Contributor

👍 from me after you address my comments. George is also reviewing too, it seems.

access_token = response.get('access_token')
if not access_token:
# this should never happen for the edx oauth provider, but just in case...
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we log this case?

@noisecapella
Copy link
Contributor

Functionality works great

@giocalitri
Copy link
Contributor Author

I think I addressed all the comments

@@ -14,7 +14,7 @@ class EdxOrgOAuth2(BaseOAuth2):
name = 'edxorg'
ID_KEY = 'edx_id'
REQUEST_TOKEN_URL = None
EDXORG_BASE_URL = getattr(settings, 'EDXORG_BASE_URL', 'https://courses.edx.org/')
EDXORG_BASE_URL = getattr(settings, 'EDXORG_BASE_URL')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not settings.EDXORG_BASE_URL here? It will always exist

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right: just missed

@noisecapella
Copy link
Contributor

Just one nit, feel free to squash and merge 👍

Profiles get created during user creation (via signal)
and populated if it is the backend is EDX
@bdero bdero deployed to micromasters-ci-pr-91 March 24, 2016 14:46 Active
@giocalitri giocalitri merged commit b717d4b into master Mar 24, 2016
@giocalitri giocalitri deleted the gdm_profile_#73 branch March 24, 2016 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On first (OAuth) login, create a user profile
4 participants