Opened 16 years ago

Closed 16 years ago

#7182 closed (invalid)

Extra MultiWidget fields in Inline in Admin are validating when left blank

Reported by: mwdiers <martin@…> Owned by: nobody
Component: contrib.admin Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The fix to bug 7160 caused a regression. Now when saving a record with an Inline, any "extra" fields in the inline are being validated, even when left empty, and thus are throwing "This Field is Required" errors.

Change History (6)

comment:1 Changed 16 years ago by Brian Rosner

Can you please provide more specific details? The only change made in [7517] was to the MultiWidget which would indicate the problem still exists with it. You say "extra fields" and I am not sure what exactly you mean?

comment:2 Changed 16 years ago by mwdiers <martin@…>

Summary: Extra fields in Inline in Admin are validating when left blankExtra MultiWidget fields in Inline in Admin are validating when left blank

Extra fields as in the extra blank records which are displayed for TabularInline or StackedInline editing:

class TextRangeInline(admin.StackedInline):
	model = TextRange
	extra = 3
	listdisplay = ('start', 'end',)

Start and End are MultiValueFields stored as Integers, and edited through a MultiWidget.

So I would imagine that the problem would net occur when the Inline contains no MultiWidget fields.

comment:3 Changed 16 years ago by Brian Rosner

I can't reproduce the problem. Are start and end required fields? If not then make sure you have have marked them as not being required. I am beginning to wonder if the bug fix has uncovered a problem in your code. If you can post some more specific details that would be nice otherwise I will close this ticket. For the record listdisplay isn't even a valid option. Neither does list_display even mean anything for an inline. ;)

comment:4 Changed 16 years ago by mwdiers <martin@…>

You are correct. Sorry for the false alarm.

My MultiWidget had a Select Widget, and the first line of my choices was (None, '------------'). This worked before. None was being recognized as no selection. Now, after the MultiWidget fix, None was being recognized as a selection. I changed the first line of choices to (, '------------'), which corrected the problem.

Not sure how listdisplay got in there originally.

comment:5 Changed 16 years ago by mwdiers <martin@…>

WikiFormatting screwed that up. Rather, first choice was changed to:

('', '------------')

comment:6 Changed 16 years ago by mwdiers <martin@…>

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top