"View on site" link breaks when quote(object_id) != object_id
|Reported by:||dchandek||Owned by:||dlanger|
|Cc:||dchandek, ldelaveau@…||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The change_view method of django.contrib.admin.options.ModelAdmin returns object_id as passed in. This means that the "View on site" link breaks in cases where the django.contrib.admin.util.quote(object_id) != object_id.
There are two possible solutions:
1) Call django.contrib.admin.util.unquote() on object_id before returning to change_view template;
2) Call django.contrib.admin.util.unquote() on object_id in django.contrib.contenttypes.views.shortcut in this line: obj = content_type.get_object_for_this_type(pk=object_id).
Attached are svn diffs for each.
Change History (12)
comment:1 Changed 2 years ago by dchandek
- Cc dchandek added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 follow-up: ↓ 3 Changed 2 years ago by julien
- Component changed from Uncategorized to contrib.admin
- Needs tests set
- Triage Stage changed from Unreviewed to Accepted
comment:7 Changed 20 months ago by dlanger
- Owner changed from nobody to dlanger
- Status changed from new to assigned