Blame mbs-empty-server-name.patch

a730ceb
diff --git a/module_build_service/manage.py b/module_build_service/manage.py
a730ceb
index 2c94f87..866dbde 100644
a730ceb
--- a/module_build_service/manage.py
a730ceb
+++ b/module_build_service/manage.py
a730ceb
@@ -125,7 +125,7 @@ def cleardb():
a730ceb
 def build_module_locally(url, branch, skiptests=False):
a730ceb
     """ Performs local module build using Mock
a730ceb
     """
a730ceb
-    if 'SERVER_NAME' not in app.config:
a730ceb
+    if 'SERVER_NAME' not in app.config or not app.config['SERVER_NAME']:
a730ceb
         app.config["SERVER_NAME"] = 'localhost'
a730ceb
 
a730ceb
     with app.app_context():
a730ceb
diff --git a/module_build_service/models.py b/module_build_service/models.py
a730ceb
index 6786968..01f0c37 100644
a730ceb
--- a/module_build_service/models.py
a730ceb
+++ b/module_build_service/models.py
a730ceb
@@ -81,7 +81,7 @@ def make_session(conf):
a730ceb
     Yields new SQLAlchemy database sesssion.
a730ceb
     """
a730ceb
     # Needs to be set to create app_context.
a730ceb
-    if 'SERVER_NAME' not in app.config:
a730ceb
+    if 'SERVER_NAME' not in app.config or not app.config['SERVER_NAME']:
a730ceb
         app.config['SERVER_NAME'] = 'localhost'
a730ceb
 
a730ceb
     # If there is no app_context, we have to create one before creating