Opened 10 years ago

Closed 9 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: master
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: UI/UX:

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@… 10 years ago.
deleted_objects_fix2.diff (12.5 KB) - added by Glin <glin@…> 9 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 years ago by anonymous

Keywords: _get_deleted_objects added; _get_deleted_objects' removed

comment:2 Changed 10 years ago by Gary Wilson <gary.wilson@…>

Triage Stage: UnreviewedAccepted

Changed 10 years ago by philippe.raoult@…

Attachment: deleted_objects_fix.diff added

comment:3 Changed 10 years ago by philippe.raoult@…

Has patch: set

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

comment:4 Changed 10 years ago by Simon G. <dev@…>

Triage Stage: AcceptedReady for checkin

comment:5 Changed 10 years ago by Malcolm Tredinnick

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 Changed 10 years ago by Malcolm Tredinnick

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.

Changed 9 years ago by Glin <glin@…>

Attachment: deleted_objects_fix2.diff added

comment:7 Changed 9 years ago by Glin <glin@…>

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 Changed 9 years ago by Glin <glin@…>

Resolution: duplicate
Status: newclosed

This was solved in #4524.

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