Opened 16 years ago

Closed 15 years ago

#6033 closed (fixed)

validation shouldn't take place when deleting inline objects

Reported by: Antti Kaihola Owned by: nobody
Component: contrib.admin Version: newforms-admin
Severity: Keywords: nfa-someday inline delete validation newforms
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As noted originally in a comment to #5828, I noticed a slight usability problem with inline editing. I have a related model which only has a foreign key to the parent model and an e-mail field. So in the inline view I see the e-mail field and the delete checkbox. If I both clear the e-mail field and check the delete checkbox, I get a validation error for the blank e-mail address, which doesn't make sense since I'm removing it anyway.

Brosner commented: "Interesting point. Sounds like the deletion needs to happen before any validation. akaihola, could you open a new ticket about that. That is unrelated to this ticket, but is a good point. I'd hate for this ticket to be fixed and your issue doesn't get fixed as it should."

Attachments (5)

is_empty_clean_field.diff (4.8 KB ) - added by Øyvind Saltvik <oyvind@…> 16 years ago.
Attempt at fixing this issue
is_empty_clean_field.2.diff (6.3 KB ) - added by Øyvind Saltvik <oyvind@…> 16 years ago.
Closer, still some problems with form for queryset/BaseModelFormSet
is_empty_clean_field.3.diff (7.9 KB ) - added by Øyvind Saltvik <oyvind@…> 16 years ago.
Patched against the correct path/ includes patch from #5828
is_empty_clean_field.4.diff (5.7 KB ) - added by Øyvind Saltvik <oyvind@…> 16 years ago.
This one actually works
is_empty_clean_field.5.diff (4.8 KB ) - added by Øyvind Saltvik <oyvind@…> 16 years ago.
Got to remember to look at my patches before posting them

Download all attachments as: .zip

Change History (12)

by Øyvind Saltvik <oyvind@…>, 16 years ago

Attachment: is_empty_clean_field.diff added

Attempt at fixing this issue

comment:1 by Øyvind Saltvik <oyvind@…>, 16 years ago

The problem here is that cleaned_data does not exist on the form if full clean does not validate.

Tried solving it by adding a clean_field method to the formset to clean only specific fields on the form.

Comments appreciated.

by Øyvind Saltvik <oyvind@…>, 16 years ago

Attachment: is_empty_clean_field.2.diff added

Closer, still some problems with form for queryset/BaseModelFormSet

comment:2 by Øyvind Saltvik <oyvind@…>, 16 years ago

Latest patch seems to work.

by Øyvind Saltvik <oyvind@…>, 16 years ago

Attachment: is_empty_clean_field.3.diff added

Patched against the correct path/ includes patch from #5828

comment:3 by Øyvind Saltvik <oyvind@…>, 16 years ago

Just noticed this patch only deletes if all rows are checked.

by Øyvind Saltvik <oyvind@…>, 16 years ago

Attachment: is_empty_clean_field.4.diff added

This one actually works

by Øyvind Saltvik <oyvind@…>, 16 years ago

Attachment: is_empty_clean_field.5.diff added

Got to remember to look at my patches before posting them

comment:4 by Øyvind Saltvik <oyvind@…>, 16 years ago

Has patch: set
Keywords: validation newforms added

comment:5 by Brian Rosner, 16 years ago

Keywords: nfa-someday added
Triage Stage: UnreviewedDesign decision needed

I am really on the fence with this idea now. The end-user may argue otherwise with a valid argument. The changes stem out of newforms-admin to be accomplished. However, the bottom line is that this is not critical before merging so I am tagging with nfa-someday.

comment:6 by MarisN, 15 years ago

As my users hit this issue time to time and also NFA can be considered stable, would it be possible to fix this issue? As my python sk33lz are poor, no comments about patches.

comment:7 by jkocherhans, 15 years ago

Resolution: fixed
Status: newclosed

This was fixed in [10283].

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