Opened 16 years ago

Closed 16 years ago

#4524 closed (worksforme)

'Delete' action is broken in newforms-admin

Reported by: dottedmag@… Owned by: Adrian Holovaty
Component: contrib.admin Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


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/ 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.

Change History (10)

comment:1 Changed 16 years ago by yi.codeplayer at gmail dot com

Resolution: fixed
Status: newclosed

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)

comment:2 Changed 16 years ago by dottedmag@…

Resolution: fixed
Status: closedreopened

Reopen: bug still present in newforms-admin branch.

Workaround is not a justification.

comment:3 Changed 16 years ago by anonymous

Resolution: duplicate
Status: reopenedclosed

comment:4 Changed 16 years ago by anonymous

Resolution: duplicate
Status: closedreopened

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

comment:5 Changed 16 years ago by Simon G. <dev@…>

Triage Stage: UnreviewedAccepted

Hmmm.. Please don't do anonymous triage.

comment:6 Changed 16 years ago by Russell Keith-Magee

Resolution: fixed
Status: reopenedclosed

(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.

comment:7 Changed 16 years ago by anonymous

Resolution: fixed
Status: closedreopened

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

comment:8 Changed 16 years ago by Karen Tracey <kmtracey@…>

Resolution: worksforme
Status: reopenedclosed

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

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

comment:9 Changed 16 years ago by ariddell <allen.riddell@…>

Resolution: worksforme
Status: closedreopened

Still getting it in 6525

This error seems pretty clear:

/usr/lib/python2.5/site-packages/django/contrib/admin/ 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

comment:10 Changed 16 years ago by ariddell <allen.riddell@…>

Resolution: worksforme
Status: reopenedclosed

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

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