Opened 5 years ago

Closed 5 years ago

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

Download all attachments as: .zip

Change History (8)

comment:1 Changed 5 years ago by bparker

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from admin model inline's exclude with single member tuple and no comma does not produce an error to admin model's exclude with single member tuple and no comma does not produce an error

comment:2 Changed 5 years ago by bparker

Python version is 2.5.4

comment:3 Changed 5 years ago by russellm

  • Component changed from Uncategorized to django.contrib.admin
  • milestone set to 1.2
  • Triage Stage changed from Unreviewed to Accepted

Changed 5 years ago by ramiro

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

comment:4 Changed 5 years ago by ramiro

  • Has patch set

comment:5 Changed 5 years ago by kmtracey

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

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

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

  • milestone 1.2 deleted

Milestone 1.2 deleted

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