#26896: FileSystemStorage no longer accepts reverse_lazy as base_url
-------------------------------------+-------------------------------------
Reporter: tpazderka | Owner: nobody
Type: Bug | Status: new
Component: File | Version: 1.8
uploads/storage |
Severity: Normal | Resolution:
Keywords: storage, | Triage Stage:
reverse_lazy | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> 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`.
New description:
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`.
--
Comment:
Could you provide a test for `tests/file_storage/tests.py` that
demonstrates your use case?
--
Ticket URL: <https://code.djangoproject.com/ticket/26896#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.709927b8377f01ed4ea3cdcbcaf41248%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.