Code

Opened 7 years ago

Closed 7 years ago

#4398 closed (fixed)

[newforms-admin] js variable in models.Admin class

Reported by: Baptiste <baptiste.goupil@…> Owned by: adrian
Component: contrib.admin Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description (last modified by adrian)

In the admin class, if you do :

js = ['http://127.0.0.1:8000/mediafiles/admin.js']

It will be rendered like that in the admin :

<script src="/media/http://127.0.0.1:8000/mediafiles/admin.js" type="text/javascript"/>

Doc says : « If you use relative URLs — URLs that don’t start with http:// or / — then the admin site will automatically prefix these links with settings.ADMIN_MEDIA_PREFIX. », so I guess this is a bug.

Attachments (1)

4398_newforms_admin_js_path_fix.diff (848 bytes) - added by Brian Rosner <brosner@…> 7 years ago.
patch to fix #4398

Download all attachments as: .zip

Change History (8)

comment:1 Changed 7 years ago by adrian

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

(Fixed formatting in description.)

comment:2 Changed 7 years ago by adrian

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 7 years ago by adrian

  • Version changed from newforms branch to newforms-admin

Changed 7 years ago by Brian Rosner <brosner@…>

patch to fix #4398

comment:4 Changed 7 years ago by Brian Rosner <brosner@…>

  • Has patch set

comment:5 Changed 7 years ago by andy@…

This incorrectly reverses the order of the the js files. I think changing line 224 to:
js_urls.insert(0,'%s%s' % (prefix, url))
will fix that.

comment:6 Changed 7 years ago by andy@…

  • Patch needs improvement set

comment:7 Changed 7 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

This issue has been resolved through the introduction of the media framework, introduced in [5926]

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.