diff --git a/awx/main/middleware.py b/awx/main/middleware.py index d0c05c89da..b68aa3e76c 100644 --- a/awx/main/middleware.py +++ b/awx/main/middleware.py @@ -98,4 +98,4 @@ class HAMiddleware(object): }) # Redirect to the base page of the primary instance. - return HttpResponseRedirect('http://%s/' % primary.ip_address) + return HttpResponseRedirect('http://%s/' % primary.hostname) diff --git a/awx/main/tests/base.py b/awx/main/tests/base.py index 4afa188755..c8b023e92a 100644 --- a/awx/main/tests/base.py +++ b/awx/main/tests/base.py @@ -218,7 +218,7 @@ class BaseTestMixin(object): return results def setup_instances(self): - instance = Instance(uuid=settings.SYSTEM_UUID, primary=True, ip_address='127.0.0.1') + instance = Instance(uuid=settings.SYSTEM_UUID, primary=True, hostname='127.0.0.1') instance.save() def setup_users(self, just_super_user=False):