Django

Code

Ticket #4524 (closed: worksforme)

Opened 1 year ago

Last modified 1 year ago

'Delete' action is broken in newforms-admin

Reported by: dottedmag@dottedmag.net Assigned to: adrian
Milestone: Component: django.contrib.admin
Version: newforms-admin Keywords:
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Any 'delete' operation in newadmin-branch (r5457) results in

Request Method:	GET
Request URL:	http://localhost:8001/admin/sites/site/2/delete/
Exception Type:	NameError
Exception Value:	global name '_get_deleted_objects' is not defined
Exception Location:	/home/mag/WORK/django-newforms-admin/django/contrib/admin/options.py in delete_view, line 531

How to reproduce:

1. Create new empty project, 2. Enable django.contrib.admin, 3. Navigate to admin interface, 4. Try to delete any object.

Attachments

Change History

06/16/07 13:02:55 changed by yi.codeplayer at gmail dot com

  • status changed from new to closed.
  • needs_better_patch changed.
  • resolution set to fixed.
  • needs_tests changed.
  • needs_docs changed.

I found a quick way to fix this, just import the name _get_deleted_objects from module django.contrib.admin.views before you use it.

e.t. change the line where this exception occured to:

        from django.contrib.admin.views.main import _get_deleted_objects
        _get_deleted_objects(deleted_objects, perms_needed, request.user, obj, opts, 1)

06/19/07 05:45:39 changed by dottedmag@dottedmag.net

  • status changed from closed to reopened.
  • resolution deleted.

Reopen: bug still present in newforms-admin branch.

Workaround is not a justification.

08/12/07 14:36:56 changed by anonymous

  • status changed from reopened to closed.
  • resolution set to duplicate.

08/23/07 13:14:06 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.

What ticket number is this a duplicate of? I don't see another ticket for this issue (which is actually a pretty critical bug).

08/23/07 17:44:48 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Unreviewed to Accepted.

Hmmm.. Please don't do anonymous triage.

08/24/07 07:54:00 changed by russellm

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [5997]) newforms-admin: Fixed #4524 -- Fixed object deletion in the admin interface. Moved get_deleted_objects to a util package rather than importing from the existing location (where it is no longer required). This was to resolve a circular import problem.

10/15/07 08:08:01 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.

I'm still getting this with newforms-admin 0.97-newforms-admin-SVN-6454

10/15/07 10:13:53 changed by Karen Tracey <kmtracey@gmail.com>

  • status changed from reopened to closed.
  • resolution set to worksforme.

Works for me with: Django version 0.97-newforms-admin-SVN-6522

I tried both a simple delete and cascading one, both worked fine.

10/17/07 10:54:41 changed by ariddell <allen.riddell@gmail.com>

  • status changed from closed to reopened.
  • resolution deleted.

Still getting it in 6525

This error seems pretty clear:

/usr/lib/python2.5/site-packages/django/contrib/admin/options.py in delete_view

line 659 reads:

from django.contrib.admin.views.main import _get_deleted_objects

there is no function _get_deleted_objects in django.contrib.admin.views.main

10/17/07 11:00:39 changed by ariddell <allen.riddell@gmail.com>

  • status changed from reopened to closed.
  • resolution set to worksforme.

nevermind, I had modified my copy of options.py per the instructions in the first comment. sorry!


Add/Change #4524 ('Delete' action is broken in newforms-admin)




Change Properties
Action