Commit 5dab922
fix: scope models imports in utils/files.py to break boot-time circular import
The GCS storage backend imports utils.files at module load. files' top-level
`from contentcuration.models import File / generate_object_storage_name` then
re-entered a partially initialized contentcuration.models during app boot
(DEFAULT_FILE_STORAGE=GCS), raising ImportError and crash-looping the pods.
The test suite missed it: pytest imports models early, so models is complete
before the storage modules load files.
Move File and generate_object_storage_name imports into their call sites
(create_file_from_contents, get_file_diff, get_thumbnail_encoding).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019ineqU2EGLAcWW2WPWR3mE1 parent 67181da commit 5dab922
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
| |||
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
104 | 114 | | |
105 | 115 | | |
106 | 116 | | |
| |||
0 commit comments