Opened 18 years ago

Closed 17 years ago

#3522 closed (duplicate)

[newforms-admin] global name '_get_deleted_objects' is not defined

Reported by: rpercy@… Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords: newforms-admin _get_deleted_objects
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Under the newforms-admin branch, deleting an object through the admin results in the following error:

Request Method: GET
Request URL: http://djangotest/admin/sandbox/book/2/delete/
Exception Type: NameError
Exception Value: global name '_get_deleted_objects' is not defined
Exception Location: /usr/lib/python2.4/site-packages/django/contrib/admin/options.py in delete_view, line 466

models.py:
from django.db import models

# Create your models here.
class Book(models.Model):    
    name = models.CharField(maxlength=100)
    
    class Admin:
        pass

Attachments (2)

deleted_objects_fix.diff (562 bytes ) - added by philippe.raoult@… 18 years ago.
deleted_objects_fix2.diff (12.5 KB ) - added by Glin <glin@…> 18 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by anonymous, 18 years ago

Keywords: _get_deleted_objects added; _get_deleted_objects' removed

comment:2 by Gary Wilson <gary.wilson@…>, 18 years ago

Triage Stage: UnreviewedAccepted

by philippe.raoult@…, 18 years ago

Attachment: deleted_objects_fix.diff added

comment:3 by philippe.raoult@…, 18 years ago

Has patch: set

The attached patch fixes the bug. It's against the newforms-admin branch.

comment:4 by Simon G. <dev@…>, 18 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Malcolm Tredinnick, 18 years ago

Summary: newforms-admin: global name '_get_deleted_objects' is not defined[newforms-admin] global name '_get_deleted_objects' is not defined

Fixing title so that searches are easier.

comment:6 by Malcolm Tredinnick, 18 years ago

Triage Stage: Ready for checkinDesign decision needed

Since the whole _get_deleted_objects() function is only for internal use and is only called by itself and the admin delete view, it's probably better to move the whole function into the place where it's used.

I'm not going to apply this one for the time being. Adrian can decide how he wants to break up the code.

by Glin <glin@…>, 18 years ago

Attachment: deleted_objects_fix2.diff added

comment:7 by Glin <glin@…>, 18 years ago

Well, first patch don't work anymore (because circular dependencies), so the only left option is to move whole _get_deleted_objects() function into the place where it's used. I attached patch, which do that.

Please try to fix this asap, because whole delete view don't work because of this.

comment:8 by Glin <glin@…>, 17 years ago

Resolution: duplicate
Status: newclosed

This was solved in #4524.

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