Opened 9 years ago
Last modified 9 years ago
#26896 closed Bug
FileSystemStorage no longer accepts reverse_lazy as base_url — at Version 1
| Reported by: | tpazderka | Owned by: | nobody | 
|---|---|---|---|
| Component: | File uploads/storage | Version: | 1.8 | 
| Severity: | Normal | Keywords: | storage, reverse_lazy | 
| Cc: | Claude Paroz | Triage Stage: | Accepted | 
| Has patch: | yes | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description (last modified by )
Changes introduced with commit [fb9d8f06] fixing #22717 causes FileSystemStorage to evaluate the content of base_url uppon initialization.
This causes issues if the base_url is defined as reverse_lazy as it is resolved and can cause ImportError.
I think that the laziness of the base_url should be preserved. Either the check for the trailing slash can me moved to path generation or the __init__ can be updated to expect reverse_lazy as base_url.
Change History (2)
comment:1 by , 9 years ago
| Description: | modified (diff) | 
|---|
by , 9 years ago
| Attachment: | 0001-Test-for-reverse_lazy.patch added | 
|---|
Patch for tests/file_storage/tests.py
Could you provide a test for
tests/file_storage/tests.pythat demonstrates your use case?