Repository navigation
Skip login after registration (mostly for NYIF) #174
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
Changes from 4 commits
a05f9fa
6b25443
425efc5
0dbd8c5
e8fd8a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,3 +110,15 @@ | |
| if 'LMS_AUTHENTICATION_BACKENDS' in APPSEMBLER_FEATURES.keys(): | ||
| #default behavior is to replace the existing backends with those in APPSEMBLER_FEATURES | ||
| AUTHENTICATION_BACKENDS = tuple(APPSEMBLER_FEATURES['LMS_AUTHENTICATION_BACKENDS']) | ||
|
|
||
| #attempt to import model from our custom fork of edx-organizations | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not specific to this PR at all. But we do need to DRY in the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. And @johnbaldwin has raised this same point as well: https://trello.com/c/wfj1jPTd/98-dry-up-awsappsembler-and-devstackappsembler-py-files That's what I was attempting to do with the But with this setup we were running into some problems. I can't remember specifically, but I think it was related to the fact that this file was called without importing We can definitely do this, we just need to be careful about how we structure the imports. |
||
| # if it works, then also add the middleware | ||
| try: | ||
| from organizations.models import UserOrganizationMapping | ||
| MIDDLEWARE_CLASSES += ( | ||
| 'organizations.middleware.OrganizationMiddleware', | ||
| ) | ||
| except ImportError: | ||
| pass | ||
|
|
||
|
|
||
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.
Looks much better. I'd like to take it further:
Why not completely avoid the
try/except? I think havingif u'organizations.backends.OrganizationMemberBackend' in settings.AUTHENTICATION_BACKENDS:makes it safe to assume that all the rest will go well:Do we expect that
organization = request.site.organizations.first()to beNone? If so, let's keep theif organization:part.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.
That's a good point. I'll remove the
try/except. I do expectorganization = request.site.organizations.first()to returnNonewhen the site in question is the default site, so I'm going to leave that lastifstatement in there.Making that change and merging.