Commit 5814476
fix: set COTTON_DIR (singular) in CfUiConfig — django-cotton never read COTTON_DIRS
django-cotton 2.x reads settings.COTTON_DIR (a single string), not COTTON_DIRS
(a list). The previous append-to-COTTON_DIRS path was a no-op at runtime, so
every <c-cf.*> raised TemplateDoesNotExist in any consumer template that
rendered a cf component unconditionally. The unit test asserted the wrong
invariant (membership in COTTON_DIRS) and the E2E settings file masked the
bug by pre-setting COTTON_DIR itself, so CI stayed green.
ready() now sets COTTON_DIR to "cotton/<theme>" only when the consumer hasn't
already set it. django-cotton's loader auto-walks each app's templates/ dir,
so <c-cf.notification> resolves to cf_ui/templates/cotton/<theme>/cf/notification.html
without any TEMPLATES["DIRS"] coordination. The multi-theme directory layout
is preserved.
Fixes #3.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 7adc77b commit 5814476
2 files changed
Lines changed: 9 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 38 | + | |
42 | 39 | | |
43 | 40 | | |
44 | 41 | | |
| |||
0 commit comments