Opened 18 years ago

Closed 17 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

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.

Change History (10)

comment:1 by yi.codeplayer at gmail dot com, 18 years ago

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 by dottedmag@…, 18 years ago

Resolution: fixed
Status: closedreopened

Reopen: bug still present in newforms-admin branch.

Workaround is not a justification.

comment:3 by anonymous, 17 years ago

Resolution: duplicate
Status: reopenedclosed

comment:4 by anonymous, 17 years ago

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 by Simon G. <dev@…>, 17 years ago

Triage Stage: UnreviewedAccepted

Hmmm.. Please don't do anonymous triage.

comment:6 by Russell Keith-Magee, 17 years ago

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 by anonymous, 17 years ago

Resolution: fixed
Status: closedreopened

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

comment:8 by Karen Tracey <kmtracey@…>, 17 years ago

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 by ariddell <allen.riddell@…>, 17 years ago

Resolution: worksforme
Status: closedreopened

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

comment:10 by ariddell <allen.riddell@…>, 17 years ago

Resolution: worksforme
Status: reopenedclosed

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

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