Code

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#21490 closed Bug (fixed)

Wrong example in docs for reversing Admin URLs using custom instance

Reported by: glarrain Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: yes UI/UX: no

Description

This example in the docs

change_url = urlresolvers.reverse('custom:polls_choice_change', args=(c.id,))

should be

change_url = urlresolvers.reverse('admin:polls_choice_change', args=(c.id,), current_app='custom')

The paragraph introducing the example is correct: "If you want to find a URL in a specific admin instance, provide the name of that instance as a current_app hint to the reverse call"

Attachments (0)

Change History (6)

comment:1 Changed 5 months ago by Tim Graham <timograham@…>

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

In bfe7377adbc0d10dc553a317671c193dce692ad3:

Fixed #21490 -- Fixed custom admin URL reverse example.

Thanks glarrain for the report.

comment:2 Changed 5 months ago by Tim Graham <timograham@…>

In af65860c5bc8f5efb76df9078284996cf55114f5:

[1.6.x] Fixed #21490 -- Fixed custom admin URL reverse example.

Thanks glarrain for the report.

Backport of bfe7377adb from master

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

In 0934894976042033d74f809cefa229b82cff85f2:

[1.5.x] Fixed #21490 -- Fixed custom admin URL reverse example.

Thanks glarrain for the report.

Backport of bfe7377adb from master

comment:4 Changed 5 months ago by Tim Graham <timograham@…>

In 03bc0a8ac5b465a9a1ec88dedb0a2f4bd91dd547:

Fixed typo in previous commit; refs #21490.

comment:6 Changed 5 months ago by Tim Graham <timograham@…>

In c0c77955629b27869ba78b91e1cb9b057860a3fc:

[1.5.x] Fixed typo in previous commit; refs #21490.

Backport of 03bc0a8ac5 from master

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

In df18cc632cd78d575f434310724034630cc84304:

[1.6.x] Fixed typo in previous commit; refs #21490.

Backport of 03bc0a8ac5 from master

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.