-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add link/unlink to common/djangoapps/third_party_auth. #3408
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
Add link/unlink to common/djangoapps/third_party_auth. #3408
Conversation
lms/templates/dashboard.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change <a href="{logout_url}">log out</a> to look like
{link_start}log out{link_end} where link_start=<a href="logout_url"> and link_end=</a>? This makes it a lot easier for the translators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (though used %s rather than .format to calculate the args to .format, as with the strong tag).
|
@sarina Review comments addressed in 351917f. |
|
@nedbat, @jzoldak, @marcotuts: ping on this review request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asserts should be about what cannot possibly happen, due to the structure of the code. This function is only called from the dashboard view, and accepts data from the request (I think?) Is an assert the right thing here, or a test and a raise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function does not accept data from the request. messages is populated by python-social-auth's exception middleware's process_exception() call (https://github.com/omab/python-social-auth/blob/master/social/apps/django_app/middleware.py).
An invariant of that code is one call produces one message, and if that invariant were violated this code could silently begin returning incorrect values. The most likely cause of invariant violation would be bumping the version of python-social-auth to a version with a different implementation of process_exception(). In that case, this assert would cause tests to fail loudly with a localized error.
Since there's no way for callers to recover from such an error, raising a more specific exception is not useful.
|
@johncox-google I won't be able to get to this (and 3450) until next week. |
|
Looks like this pull request has failing tests, and it needs to be rebased. |
|
Sure, but rebasing is best done immediately before a merge, right? |
|
@johncox-google in this case, the pull request has conflicts with master -- doing the rebase now will surface those conflicts, so they can be resolved cleanly during the code review process. If we wait until just before merge to do the rebase, then there wouldn't be any review of how those conflicts were resolved. |
|
@singingwolfboy Understood -- we're planning to merge https://github.com/edx/edx-platform/pull/3450 instead of this PR since it's a superset; I'm rebasing/repushing that now. |
|
@johncox-google Ah, OK. Do you want to close this PR, then? |
|
@singingwolfboy Yup, this one and 2994 once 3450 is in. |
|
@singingwolfboy Working with @nedbat on the merge of 3450 now, so hopefully this won't be long-lived. :) |
|
OK, merged as part of https://github.com/edx/edx-platform/pull/3450. Thanks, all (and shout out to @nedbat for all his help with the final merge). |
@nedbat, @jzoldak, @marcotuts: Here's the account link/unlink part of the third-party-auth feature set. @marcotuts has reviewed the UX already.
This PR depends upon (and must not be merged before) https://github.com/edx/edx-platform/pull/2994, but I wanted to start the review now. It's 2994 up to 2a69765; please have a look at 87c90f5 and after.
@psimakov, @mgainer, @jbau, @alexmdavis, @version101, @AnuragRamdasan: just tagging you to keep you in the loop; nothing you need to do.