Skip to content

Fix circular import breaking deploy#6036

Merged
rtibbles merged 1 commit into
learningequality:hotfixesfrom
rtibbles:fix/resumable-upload-circular-import
Jul 11, 2026
Merged

Fix circular import breaking deploy#6036
rtibbles merged 1 commit into
learningequality:hotfixesfrom
rtibbles:fix/resumable-upload-circular-import

Conversation

@rtibbles

Copy link
Copy Markdown
Member

Summary

Fixes deploy issue not shown by tests.

References

Clean up from #5995

AI usage

Had Claude quickly trace this from the log output in hotfixes

…ar 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_019ineqU2EGLAcWW2WPWR3mE
@rtibbles rtibbles merged commit a01bd10 into learningequality:hotfixes Jul 11, 2026
20 checks passed
@rtibbles rtibbles deleted the fix/resumable-upload-circular-import branch July 11, 2026 04:19
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.

1 participant