subdomains: Fix some implicit uses of "" for the root subdomain.

These are just instances that jumped out at me while working on the
subdomains code, mostly while grepping for get_subdomain call sites.
I haven't attempted a comprehensive search, and there are likely
still others left.
This commit is contained in:
Greg Price
2017-10-19 17:56:49 -07:00
committed by Tim Abbott
parent 27adbe8d79
commit 093bae4bc5
6 changed files with 12 additions and 8 deletions

View File

@@ -660,7 +660,7 @@ def get_auth_backends_data(request):
realm = Realm.objects.get(string_id=subdomain)
except Realm.DoesNotExist:
# If not the root subdomain, this is an error
if subdomain != "":
if subdomain != Realm.SUBDOMAIN_FOR_ROOT_DOMAIN:
raise JsonableError(_("Invalid subdomain"))
# With the root subdomain, it's an error or not depending
# whether ROOT_DOMAIN_LANDING_PAGE (which indicates whether