From 5ba5fe8d4f31b66af67137cc36f79597138b76b0 Mon Sep 17 00:00:00 2001 From: Alex Dehnert Date: Sun, 7 Jul 2013 00:27:57 -0400 Subject: [PATCH] Scripts auth: don't activate on 127.0.0.1 either The scripts auth module has long delegated to the standard Django auth when the hostname was localhost, in order to ignore local dev server instances. This makes it also delegate to standard Django for 127.0.0.1 as well. I'm not sure why this hadn't come up before now... A quick look at the Django codebase suggests this isn't a recent change. --- __init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 73e7e88..4d09313 100644 --- a/__init__.py +++ b/__init__.py @@ -129,7 +129,7 @@ def get_or_create_mit_user(username, ): def scripts_login(request, **kwargs): host = request.META['HTTP_HOST'].split(':')[0] - if host == 'localhost': + if host in ('localhost', '127.0.0.1'): return login(request, **kwargs) elif request.META['SERVER_PORT'] == '444': if request.user.is_authenticated(): -- 2.44.0