Skip to content

Conversation

@carsongee
Copy link
Contributor

The @ssl_login_shortcut() decorator has been broken in the edX codebase for some time, because it did not properly wrap the function being decorated and pass this along to be called after authentication is completed.

This PR fixes that bug.

The changes made have been in production in the residential MITx systems at MIT since spring 2013.

This is an update of PR #653 with tests and the removal of the IMMEDIATE_SIGNUP_FEATURE

Copy link
Contributor

Choose a reason for hiding this comment

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

Code coverage suggests that this line isn't tested. Is this something easy to add a test for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brianhw Both of our auth entry functions set retfun, so this can't be hit without calling _external_signup directly. Should I make an "artificial" test directly to _signup with retfun set to None to test, or be bold and remove the safety redirect?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's also called by openid_login_complete(), appearing above it. And in that case the retfun is not set. So don't remove the redirect, unless you move it up into openid_login_complete(). Which is a reasonable option (and remove the default value for retfun=None).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I honestly hadn't thought of what it would look like to have those both turned on. I'll leave it in as it is worth handling either way.

@brianhw
Copy link
Contributor

brianhw commented Dec 5, 2013

Code looks good. Just checking on the diff test results, and noting its flags.

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't typically provide docstrings for unittests (see http://stackoverflow.com/questions/12962772/how-to-stop-python-unittest-from-printing-test-docstring) -- only for helper functions for tests. NBD here but for future development, now you know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll keep that in mind for the future.

@sarina
Copy link
Contributor

sarina commented Dec 10, 2013

👍 once a few minor comments are addressed.

@wedaly
Copy link
Contributor

wedaly commented Dec 12, 2013

@sarina I think clearer failure messages trump line coverage in this case. 👍 On the tests

@sarina
Copy link
Contributor

sarina commented Dec 12, 2013

@wedaly thanks!

@carsongee looks like there are conflicts today. Can you do another rebase?

@brianhw can you look at this today or tomorrow so we can merge it and avoid having to make Carson continually rebase? :)

@brianhw
Copy link
Contributor

brianhw commented Dec 12, 2013

Looks good. 👍

@sarina
Copy link
Contributor

sarina commented Dec 12, 2013

@carsongee once you get a clean build, go ahead and merge this.

@carsongee
Copy link
Contributor Author

Cool, will do. Thanks everyone

carsongee added a commit that referenced this pull request Dec 12, 2013
Fix external_auth to properly use retfun for @ssl_login_shortcut()
@carsongee carsongee merged commit 8261f2b into openedx:master Dec 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants