Opened 17 years ago
Closed 16 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)
Change History (12)
by , 17 years ago
Attachment: | is_empty_clean_field.diff added |
---|
comment:1 by , 17 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 , 17 years ago
Attachment: | is_empty_clean_field.2.diff added |
---|
Closer, still some problems with form for queryset/BaseModelFormSet
by , 17 years ago
Attachment: | is_empty_clean_field.3.diff added |
---|
Patched against the correct path/ includes patch from #5828
by , 17 years ago
Attachment: | is_empty_clean_field.5.diff added |
---|
Got to remember to look at my patches before posting them
comment:4 by , 17 years ago
Has patch: | set |
---|---|
Keywords: | validation newforms added |
comment:5 by , 17 years ago
Keywords: | nfa-someday added |
---|---|
Triage Stage: | Unreviewed → Design 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 , 16 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.
Attempt at fixing this issue