Opened 3 years ago

Closed 3 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 Changed 3 years ago by Eric Whitmire

Has patch: set

comment:2 Changed 3 years ago by Simon Charette

Patch needs improvement: set
Triage Stage: UnreviewedAccepted
Version: 1.8master

Please open a new PR against master, we'll take of backporting.

comment:3 Changed 3 years ago by Simon Charette

Patch needs improvement: unset
Version: master1.8

The master branch is not affected.

comment:4 Changed 3 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

Will add release notes and commit.

comment:5 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In 901de5f:

[1.8.x] Fixed #24655 -- Fixed JavaScript path of contrib.admin's related field widget

Note: See TracTickets for help on using tickets.
Back to Top