Code

Opened 7 years ago

Closed 7 years ago

#4524 closed (worksforme)

'Delete' action is broken in newforms-admin

Reported by: dottedmag@… Owned by: adrian
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: UI/UX:

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 (0)

Change History (10)

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to fixed
  • Status changed from new to closed

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

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopen: bug still present in newforms-admin branch.

Workaround is not a justification.

comment:3 Changed 7 years ago by anonymous

  • Resolution set to duplicate
  • Status changed from reopened to closed

comment:4 Changed 7 years ago by anonymous

  • Resolution duplicate deleted
  • Status changed from closed to reopened

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

  • Triage Stage changed from Unreviewed to Accepted

Hmmm.. Please don't do anonymous triage.

comment:6 Changed 7 years ago by russellm

  • Resolution set to fixed
  • Status changed from reopened to closed

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

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

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

  • Resolution set to worksforme
  • Status changed from reopened to closed

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

  • Resolution worksforme deleted
  • Status changed from closed to reopened

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

  • Resolution set to worksforme
  • Status changed from reopened to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.