Repository: openfun/richie

Issue:
Pin dependencies in package.json to get auto-updates from Greenkeeper
## Bug Report

**Expected behavior/code**
Greenkeeper should update every possible version for every dependency

**Actual Behavior**
It only updates major versions (semver)

**Steps to Reproduce**
N/A (see Greenkeeper bot Pull Requests)

**Environment**
N/A

**Possible Solution**
https://greenkeeper.io/faq.html#pinning-versions
Pinning the versions (removing ^ will cause greenkeeper to upgrade all dependencies)



Discussion:

Resolving patch:
diff --git a/apps/core/helpers.py b/apps/core/helpers.py
--- a/apps/core/helpers.py
+++ b/apps/core/helpers.py
@@ -6,7 +6,7 @@
 from cms.api import add_plugin, create_page, create_title
 
 
-def create_i18n_page(content, is_homepage=False, **kwargs):
+def create_i18n_page(content, has_maincontent=True, is_homepage=False, **kwargs):
     """
     Creating a multilingual page is not straightforward so we thought we should have a helper
 
@@ -47,14 +47,17 @@ def create_i18n_page(content, is_homepage=False, **kwargs):
         if kwargs.get("published") is True:
             page.publish(language)
 
-    # Add a plugin for each language (including the first language this time...)
-    placeholder = page.placeholders.get(slot="maincontent")
-    for language in content.keys():
-        add_plugin(
-            body="[{:s}] Lorem ipsum...".format(language),
-            language=language,
-            placeholder=placeholder,
-            plugin_type="TextPlugin",
-        )
+    # Some pages have specific purpose templates that do not have a user-editable maincontent area
+    # One such page is the "Courses" page which uses the Search template
+    if has_maincontent:
+        # Add a plugin for each language
+        placeholder = page.placeholders.get(slot="maincontent")
+        for language in content.keys():
+            add_plugin(
+                body="[{:s}] Lorem ipsum...".format(language),
+                language=language,
+                placeholder=placeholder,
+                plugin_type="TextPlugin",
+            )
 
     return page
diff --git a/apps/core/management/commands/create_demo_site.py b/apps/core/management/commands/create_demo_site.py
--- a/apps/core/management/commands/create_demo_site.py
+++ b/apps/core/management/commands/create_demo_site.py
@@ -30,8 +30,9 @@
     "courses": {
         "content": {"en": "Courses", "fr": "Cours"},
         "kwargs": {
+            "has_maincontent": False,
             "reverse_id": Course.ROOT_REVERSE_ID,
-            "template": "richie/fullwidth.html",
+            "template": "search/search.html",
         },
     },
     "subjects": {


Test patch:
diff --git a/apps/core/tests/test_helpers.py b/apps/core/tests/test_helpers.py
--- a/apps/core/tests/test_helpers.py
+++ b/apps/core/tests/test_helpers.py
@@ -63,6 +63,17 @@ def test_utils_create_i18n_page(self, mock_title, mock_plugin, mock_homepage):
 
         self.assertFalse(mock_homepage.called)
 
+    @mock.patch("apps.core.helpers.create_title")
+    @mock.patch("apps.core.helpers.add_plugin")
+    def test_utils_create_i18n_page_without_maincontent(self, mock_plugin, *_):
+        """
+        Make sure we can create pages without the maincontent placeholder. These are pages that
+        use specific templates to perform their function.
+        """
+        content = {"fr": "Titre français", "en": "English title"}
+        create_i18n_page(content, has_maincontent=False, template="search/search.html")
+        self.assertFalse(mock_plugin.called)
+
     # pylint: disable=no-member,unused-argument
     @mock.patch("apps.core.helpers.add_plugin")
     @mock.patch("apps.core.helpers.create_title")
diff --git a/apps/core/tests/test_management_commands_create_demo_site.py b/apps/core/tests/test_management_commands_create_demo_site.py
--- a/apps/core/tests/test_management_commands_create_demo_site.py
+++ b/apps/core/tests/test_management_commands_create_demo_site.py
@@ -85,12 +85,13 @@ def test_command_create_demo_site(self, mock_page, mock_organization):
             (
                 ({"en": "Courses", "fr": "Cours"},),
                 {
+                    "has_maincontent": False,
                     "in_navigation": True,
                     "is_homepage": False,
                     "published": True,
                     "site": site,
                     "reverse_id": "courses",
-                    "template": "richie/fullwidth.html",
+                    "template": "search/search.html",
                 },
             ),
             (