Skip to content

Conversation

@johncox-google
Copy link
Contributor

@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.

Copy link
Contributor

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.

Copy link
Contributor Author

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).

@johncox-google
Copy link
Contributor Author

@sarina Review comments addressed in 351917f.

@johncox-google
Copy link
Contributor Author

@nedbat, @jzoldak, @marcotuts: ping on this review request.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@jzoldak
Copy link
Contributor

jzoldak commented Apr 24, 2014

@johncox-google I won't be able to get to this (and 3450) until next week.

@johncox-google
Copy link
Contributor Author

@jzoldak No worries -- thanks to your review of the previous tests I think we're all set (the new code is just more of the same, so @nedbat and I are working to get these in without asking other folks for additional review passes).

@singingwolfboy
Copy link
Contributor

Looks like this pull request has failing tests, and it needs to be rebased.

@johncox-google
Copy link
Contributor Author

Sure, but rebasing is best done immediately before a merge, right?

@singingwolfboy
Copy link
Contributor

@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.

@johncox-google
Copy link
Contributor Author

@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.

@singingwolfboy
Copy link
Contributor

@johncox-google Ah, OK. Do you want to close this PR, then?

@johncox-google
Copy link
Contributor Author

@singingwolfboy Yup, this one and 2994 once 3450 is in.

@johncox-google
Copy link
Contributor Author

@singingwolfboy Working with @nedbat on the merge of 3450 now, so hopefully this won't be long-lived. :)

@johncox-google
Copy link
Contributor Author

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).

@johncox-google johncox-google deleted the johncox/feature/link branch April 25, 2014 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants