Skip to content

Commit cb1a2d4

Browse files
committed
fix(bakerydemo): add missing wagtail.contrib apps and wagtailsearchpromotions stub
bakerydemo uses wagtail.contrib.settings (wagtailsettings namespace), routable_page, table_block, typed_table_block, and search_promotions. Add all five to INSTALLED_APPS via _configure_bakerydemo. Also add a MIGRATION_MODULES stub for wagtailsearchpromotions (the only one with its own migrations) and create its mongo_migrations stub directory.
1 parent b5d957c commit cb1a2d4

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

src/dbx_python_cli/commands/project.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,11 @@ def _configure_bakerydemo(project_path: Path, name: str) -> None:
742742
bakerydemo_apps = (
743743
' "bakerydemo",\n'
744744
' "wagtailfontawesomesvg",\n'
745+
' "wagtail.contrib.settings",\n'
746+
' "wagtail.contrib.routable_page",\n'
747+
' "wagtail.contrib.table_block",\n'
748+
' "wagtail.contrib.typed_table_block",\n'
749+
' "wagtail.contrib.search_promotions",\n'
745750
' "bakerydemo.base",\n'
746751
' "bakerydemo.blog",\n'
747752
' "bakerydemo.breads",\n'
@@ -759,6 +764,7 @@ def _configure_bakerydemo(project_path: Path, name: str) -> None:
759764
content = content.replace(' "search",\n', "")
760765

761766
bakerydemo_migration_entries = (
767+
' "wagtailsearchpromotions": "mongo_migrations.wagtailsearchpromotions",\n'
762768
' "base": "mongo_migrations.bakerydemo_base",\n'
763769
' "blog": "mongo_migrations.bakerydemo_blog",\n'
764770
' "breads": "mongo_migrations.bakerydemo_breads",\n'
@@ -777,16 +783,17 @@ def _configure_bakerydemo(project_path: Path, name: str) -> None:
777783

778784
mongo_migrations_dir = project_path / "mongo_migrations"
779785
if mongo_migrations_dir.exists():
780-
for app_label in (
781-
"base",
782-
"blog",
783-
"breads",
784-
"locations",
785-
"people",
786-
"recipes",
787-
"search",
786+
for stub_name in (
787+
"wagtailsearchpromotions",
788+
"bakerydemo_base",
789+
"bakerydemo_blog",
790+
"bakerydemo_breads",
791+
"bakerydemo_locations",
792+
"bakerydemo_people",
793+
"bakerydemo_recipes",
794+
"bakerydemo_search",
788795
):
789-
stub_dir = mongo_migrations_dir / f"bakerydemo_{app_label}"
796+
stub_dir = mongo_migrations_dir / stub_name
790797
stub_dir.mkdir(exist_ok=True)
791798
(stub_dir / "__init__.py").touch()
792799

0 commit comments

Comments
 (0)