Opened 2 years ago

Closed 2 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: charettes 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 2 years ago by floppya

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

comment:2 Changed 2 years ago by charettes

  • Cc charettes added
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Bug to Cleanup/optimization

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

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

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

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