zulip/zproject
Tim Abbott 64023fc563 auth: Fix incorrect use of get_realm_from_request.
The code in maybe_send_to_registration incorrectly used the
`get_realm_from_request` function to fetch the subdomain.  This usage
was incorrect in a way that should have been irrelevant, because that
function only differs if there's a logged-in user, and in this code
path, a user is never logged in (it's the code path for logged-out
users trying to sign up).

This this bug could confuse unit tests that might run with a logged-in
client session.  This made it possible for several of our GitHub auth
tests to have a totally invalid subdomain value (the root domain).

Fixing that bug in the tests, in turn, let us delete a code path in
the GitHub auth backend logic in `backends.py` that is impossible in
production, and had just been left around for these broken tests.
2018-04-22 16:24:43 -07:00
..
jinja2 django-2.0: Shift to resolvers from urlresolvers. 2018-01-30 10:53:54 -08:00
__init__.py Rename Django project to zproject. 2013-08-07 11:04:03 -04:00
backends.py auth: Fix incorrect use of get_realm_from_request. 2018-04-22 16:24:43 -07:00
dev_settings.py bots: Eliminate NEW_USER_BOT. 2018-03-29 12:01:21 -07:00
dev_urls.py test_emails: Generate emails instead of hardcoding. 2017-09-26 15:02:47 -07:00
email_backends.py zproject: Use Python 3 syntax for typing. 2017-11-27 17:01:18 -08:00
legacy_urls.py urls: Move the json/fetch_api_key endpoint to be an API-style route. 2018-01-08 13:15:52 -05:00
prod_settings_template.py settings: Add a few more section headings. 2018-04-05 21:24:48 -07:00
settings.py secrets: Make it a bit easier to do GitHub auth in development. 2018-04-22 14:44:05 -07:00
slack_importer_test_settings.py slack importer: Use standalone database for running tests. 2018-01-07 09:50:27 -05:00
terms.md.template Add TERMS_OF_SERVICE setting. 2016-07-29 20:47:31 -07:00
test_settings.py tests: Add test coverage for uploading avatars to S3UploadBackend. 2017-12-26 09:09:31 -05:00
urls.py avatars: Fix 500 with the /avatar/ URL to be a 404. 2018-04-18 12:43:57 -07:00
wsgi.py python: Add lint rule banning 'from os.path import'. 2017-09-22 04:55:38 -07:00