Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#12689 closed (fixed)

admin model's exclude with single member tuple and no comma does not produce an error

Reported by: bparker Owned by: nobody
Component: contrib.admin Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Using django 1.1 I was creating an inline and left out a comma when using a single member tuple:

class UserProfileInline(admin.StackedInline):
        model = UserProfile
        exclude = ('old_password')

But no error was produced at all... django simply ignored the exclude line and acted like it wasn't there.
Also tried it with a normal ModelAdmin and experienced the same behavior:

class CommentAdmin(admin.ModelAdmin):
        list_display = ['reservation', 'text', 'created_by', 'created_date']
        save_as = True
        exclude = ('assignment')
        form = CommentAdminForm

Is this normal behavior?

Attachments (1)

12689-1.diff (2.5 KB ) - added by Ramiro Morales 15 years ago.
Patch adding validation of 'exclude' option values, with tests

Download all attachments as: .zip

Change History (8)

comment:1 by bparker, 15 years ago

Summary: admin model inline's exclude with single member tuple and no comma does not produce an erroradmin model's exclude with single member tuple and no comma does not produce an error

comment:2 by bparker, 15 years ago

Python version is 2.5.4

comment:3 by Russell Keith-Magee, 15 years ago

Component: Uncategorizeddjango.contrib.admin
milestone: 1.2
Triage Stage: UnreviewedAccepted

by Ramiro Morales, 15 years ago

Attachment: 12689-1.diff added

Patch adding validation of 'exclude' option values, with tests

comment:4 by Ramiro Morales, 15 years ago

Has patch: set

comment:5 by Karen Tracey, 15 years ago

Resolution: fixed
Status: newclosed

(In [12734]) Fixed #12689: Fixed admin validation to report an error on invalid exclude specification. Thanks for report to bparker and for patch with tests to ramiro.

comment:6 by Karen Tracey, 15 years ago

(In [12735]) [1.1.X] Fixed #12689: Fixed admin validation to report an error on invalid exclude specification. Thanks for report to bparker and for patch with tests to ramiro.

r12734 from trunk.

comment:7 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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