Skip to content

Fix /project/0 crash when creating a new project - #12

Merged
cursor[bot] merged 7 commits into
masterfrom
cursor/fix-unsaved-project-filter-607d
Oct 6, 2026
Merged

cursor[bot] merged 7 commits into
masterfrom
cursor/fix-unsaved-project-filter-607d

Conversation

@JK-de

@JK-de JK-de commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

Live-instance bugs from Django modernization / order helpers / New UX / reports:

  1. GET /project/0 — ValueError filtering Script by an unsaved Project.
  2. GET /scene/ — NameError: Gadget / SFX after star-import cleanup.
  3. Script New → /script/0/None 404 — getOrderNumber treated index 0 as missing.
  4. Script New felt like a no-op — prefill New Scene, banner, focus name, validation alert.
  5. List → /test TemplateDoesNotExist — Scene/Shot List linked to missing scene_cards.html; now points to /report/C/script (+ simple list); legacy /test uses cards_script.html.

Also in this PR (audit)

  • Scoped twins for /p/…/s/…/script|scene|shot/0/…
  • Wire shot/0/<type>/<order> + shot/new/…
  • project.html New Script/Export no longer emit /project/None/…
  • Shot save/delete redirect to /shot/

Test plan

  • SmokeTests including /project/0 and new-scene create/save
  • BreakdownTests (Gadget/SFX)
  • Empty script New → form → Save → /script/<id>
  • /test, /report/C/script, /report/L/simple_scene → 200 (no TemplateDoesNotExist)
  • Cards POST renders cards_script.html
Open in Web Open in Cursor 

cursoragent and others added 7 commits October 6, 2026 17:42
Django 5+ rejects filtering Script by an unsaved Project instance.
Use an empty queryset for the new-project form path, and set a
build-time DJANGO_SECRET_KEY so compilemessages succeeds in Docker.

Co-authored-by: Jochen Krapf <jkdesign@me.com>
Removing star-imports left Gadget/SFX undefined in apply_breakdown
and the scene form queryset setup, crashing /scene/ and CI breakdown tests.

Co-authored-by: Jochen Krapf <jkdesign@me.com>
getOrderNumber treated refIndex 0 as missing (if not refIndex), so New
relative to the first scene redirected to /script/0/None. Empty lists
now get ORDER_STEP; script/scene/shot New harden None; templates link
empty scripts/scenes to /script/0/0 and /scene/0/<type>/0.

Co-authored-by: Jochen Krapf <jkdesign@me.com>
Co-authored-by: Jochen Krapf <jkdesign@me.com>
On /script/0/0 the selected Scene exists but has pk=None; testing
selected_scene alone still produced /script/new/None/. Same for scene/shot.

Co-authored-by: Jochen Krapf <jkdesign@me.com>
New scene form prefills "New Scene", shows a banner, focuses the name
field, and surfaces validation errors. Guard missing project/script,
coerce order to int, and activate the scene after save.

Also: scoped /script|scene|shot/0/... routes, wire shot New URL,
fix project.html None links on unsaved project, redirect shot
save/delete to /shot/.

Co-authored-by: Jochen Krapf <jkdesign@me.com>
Scene/Shot List menus linked to /test which rendered a missing
report/scene_cards.html. Point nav at /report/C/script and
/report/L/simple_scene; make legacy cards() use cards_script.html.

Co-authored-by: Jochen Krapf <jkdesign@me.com>
@cursor
cursor Bot marked this pull request as ready for review October 6, 2026 19:34
@cursor
cursor Bot merged commit 3f6e308 into master Oct 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants