Opened 4 years ago

Closed 4 years ago

#20121 closed Cleanup/optimization (fixed)

LogEntry.get_admin_url uses a hard-coded path format.

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

Description

The LogEntry model from contrib.admin assumes that admin change path for a ContentType always follows the {{app_name}}/{{model_name}}/{{id}}/ format. This causes incorrect links to be generated for the admin change log in cases where the model's change url is customized.

Change History (3)

comment:1 Changed 4 years ago by floppya

Easy pickings: set
Has patch: set
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 4 years ago by Simon Charette

Cc: Simon Charette added
Patch needs improvement: set
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization

The cleanup makes sense but the provided patch makes two regression tests fails.

comment:3 Changed 4 years ago by Simon Charette <charette.s@…>

Resolution: fixed
Status: newclosed

In a4b8a4b632dbb6d9fed1a8654aed99a9c53560d4:

Fixed #20121 -- Removed LogEntry.get_admin_url's hard-coded path.

Updated LogEntry.get_admin_url to use 'reverse' instead
of a hard-coded path.

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