Skip to content

Commit 2dd6075

Browse files
committed
fix(project): replace home with bakerydemo apps, init now in project package
home.HomePage and bakerydemo.base.HomePage both extend Wagtail Page with the same page_ptr reverse name, causing migration errors when both apps are active. Replace "home" in INSTALLED_APPS with the bakerydemo app set; the init management command is now in the project package so it remains discoverable without home.
1 parent c5dc52c commit 2dd6075

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/dbx_python_cli/commands/project.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -736,13 +736,13 @@ def _configure_bakerydemo(project_path: Path, name: str) -> None:
736736
' "bakerydemo.recipes",\n'
737737
' "bakerydemo.search",\n'
738738
)
739-
# Keep "home" (provides the init management command); replace "search" with
740-
# bakerydemo apps (bakerydemo.search has the same app label so "search" must go)
741-
if ' "search",\n' in content:
742-
content = content.replace(' "search",\n', bakerydemo_apps)
743-
elif ' "home",\n' in content:
744-
# Fallback: insert after "home" when "search" is absent
745-
content = content.replace(' "home",\n', ' "home",\n' + bakerydemo_apps)
739+
# Replace "home" with bakerydemo apps; home.HomePage conflicts with
740+
# bakerydemo.base.HomePage (same page_ptr reverse name via Wagtail).
741+
# The init management command now lives in the project package, not home.
742+
if ' "home",\n' in content:
743+
content = content.replace(' "home",\n', bakerydemo_apps)
744+
# Remove template "search" app (bakerydemo.search has the same label)
745+
content = content.replace(' "search",\n', "")
746746

747747
bakerydemo_migration_entries = (
748748
' "base": "mongo_migrations.bakerydemo_base",\n'

0 commit comments

Comments
 (0)