From 7688bb4012a2118393dca31f70cc826f9ade1c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Wed, 13 May 2020 14:43:34 +0200 Subject: [PATCH] Make sure that discovery migrations work even when LMS_HOST=localhost We adopt here a similar solution than the one we used with the LMS. This is for https://github.com/overhangio/tutor/issues/325 --- tutordiscovery/__about__.py | 2 +- tutordiscovery/templates/discovery/hooks/discovery/init | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tutordiscovery/__about__.py b/tutordiscovery/__about__.py index 970659c..86205cb 100644 --- a/tutordiscovery/__about__.py +++ b/tutordiscovery/__about__.py @@ -1 +1 @@ -__version__ = "0.1.16" +__version__ = "0.1.17" diff --git a/tutordiscovery/templates/discovery/hooks/discovery/init b/tutordiscovery/templates/discovery/hooks/discovery/init index 10c116d..e45bddb 100644 --- a/tutordiscovery/templates/discovery/hooks/discovery/init +++ b/tutordiscovery/templates/discovery/hooks/discovery/init @@ -24,6 +24,7 @@ make migrate --oidc-key "{{ DISCOVERY_OAUTH2_KEY_DEV }}" \ --oidc-secret "{{ DISCOVERY_OAUTH2_SECRET }}" +{% if DISCOVERY_HOST != "discovery.localhost" %} # Production partner ./manage.py create_or_update_partner \ --site-id 2 \ @@ -33,6 +34,7 @@ make migrate --oidc-url-root "{% if ACTIVATE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/oauth2" \ --oidc-key "{{ DISCOVERY_OAUTH2_KEY }}" \ --oidc-secret "{{ DISCOVERY_OAUTH2_SECRET }}" +{% endif %} ./manage.py refresh_course_metadata --partner_code=dev ./manage.py update_index --disable-change-limit