Opened 7 years ago

Closed 7 years ago

Last modified 5 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: UI/UX:

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 7 years ago.
Patch adding validation of 'exclude' option values, with tests

Download all attachments as: .zip

Change History (8)

comment:1 Changed 7 years ago by bparker

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
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 Changed 7 years ago by bparker

Python version is 2.5.4

comment:3 Changed 7 years ago by Russell Keith-Magee

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

Changed 7 years ago by Ramiro Morales

Attachment: 12689-1.diff added

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

comment:4 Changed 7 years ago by Ramiro Morales

Has patch: set

comment:5 Changed 7 years ago by Karen Tracey

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 Changed 7 years ago by Karen Tracey

(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 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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