Django

Code

Ticket #2856 (new)

Opened 2 years ago

Last modified 6 months ago

Admin's Recent Actions will link to a 404 when an object has been deleted.

Reported by: anonymous Assigned to:
Component: Admin interface Version: SVN
Keywords: Cc:
Triage Stage: Accepted Has patch: 1
Needs documentation: 0 Needs tests: 0
Patch needs improvement: 0

Description

A page not found (404) is begin show when clicking on an add or edit action of a (later) deleted object in Recent Actions.

For the delete action, there is already no link on the object. But the older add and edit actions in the Recent Actions list have at this time no valid URL beacause the object is already deleted.

Because this list is in chronological order, one could disable the links on the add and edit actions in Recent Actions that have taken place earlier that the delete. With again allowing a link on a later than the delete created new object with another add actin.

This change would make de admin page more stable since this will also be used with less technical personel and will ensure that the Recent Actions has only valid (non 404) URLs.

Attachments

2856.diff (3.2 kB) - added by ionut_bizau on 12/02/07 08:10:49.
Added a new field (object_exists) to LogEntry?, which becomes False after the object that that entry is referring to is deleted. I think this approach is better than just looking for the object by id, both for performance and for the situation where an object with the same id is added later. This field is then checked in the template.
authors.diff (315 bytes) - added by ionut_bizau on 12/02/07 08:35:56.
Add myself to AUTHORS.

Change History

02/22/07 01:00:18 changed by Simon G. <dev@simon.net.nz>

  • summary changed from Page not found 404 for on add and edit occurences of deleted objects listed in Recent Actions to Admin's Recent Actions will link to a 404 when an object has been deleted..
  • version changed from 0.95 to SVN.
  • stage changed from Unreviewed to Accepted.

confirmed on latest svn.

12/02/07 04:57:52 changed by anonymous

  • owner changed from nobody to anonymous.
  • status changed from new to assigned.

12/02/07 04:58:09 changed by ionut_bizau

  • owner changed from anonymous to ionut_bizau.
  • status changed from assigned to new.

12/02/07 08:10:49 changed by ionut_bizau

  • attachment 2856.diff added.

Added a new field (object_exists) to LogEntry?, which becomes False after the object that that entry is referring to is deleted. I think this approach is better than just looking for the object by id, both for performance and for the situation where an object with the same id is added later. This field is then checked in the template.

(follow-up: ↓ 5 ) 12/02/07 08:11:49 changed by ionut_bizau

  • owner deleted.
  • has_patch set to 1.

12/02/07 08:35:56 changed by ionut_bizau

  • attachment authors.diff added.

Add myself to AUTHORS.

(in reply to: ↑ 4 ; follow-up: ↓ 6 ) 12/02/07 09:19:30 changed by Karen Tracey <kmtracey@gmail.com>

Replying to:

Added a new field (object_exists) to LogEntry??, which becomes False after the object that that entry is referring to is deleted. I think this approach is better than just >looking for the object by id, both for performance and for the situation where an object with the same id is added later. This field is then checked in the template.

Isn't this a major backwards-incompatible change? My existing DB's django_admin_log table doesn't have this new field. I don't expect when I pull a new svn checkout that I have to resync my db tables to accommodate changes like this....

(in reply to: ↑ 5 ) 12/02/07 17:22:28 changed by ionut_bizau

Replying to Karen Tracey <kmtracey@gmail.com>:

Isn't this a major backwards-incompatible change? My existing DB's django_admin_log table doesn't have this new field. I don't expect when I pull a new svn checkout that I have to resync my db tables to accommodate changes like this....

Being before 1.0 I guess we can break compatibility, but I am not sure to what degree. Let's wait for input from a core member.


Add/Change #2856 (Admin's Recent Actions will link to a 404 when an object has been deleted.)




Change Properties
Action