Opened 10 years ago
Closed 10 years ago
#24655 closed Bug (fixed)
Admin RelatedFieldWidgetWrapper does not build static url correctly
Reported by: | Eric Whitmire | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
RelatedFieldWidgetWrapper requires 'admin/js/related-widget-wrapper.js' but doesn't pass it through the static url builder. As it is, django/forms/widgets.py always prepends STATIC_URL. However, this doesn't work when using a Storage class like S3BotoStorage that doesn't use STATIC_URL and results in a 404 error.
It looks like the fix is simply to add a call to static before passing the url to Media.
This functionality has changed in master so I think this only exists in 1.8.
Change History (5)
comment:1 by , 10 years ago
Has patch: | set |
---|
comment:2 by , 10 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Version: | 1.8 → master |
Please open a new PR against master, we'll take of backporting.
comment:3 by , 10 years ago
Patch needs improvement: | unset |
---|---|
Version: | master → 1.8 |
The master branch is not affected.
comment:4 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Will add release notes and commit.
Proposed fix: https://github.com/django/django/pull/4523