#2579 closed defect (fixed)
[patch] raw_id_admin with ManyToMany does not properly handle 'empty' raw_id_admin fields
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | 0.95 |
Severity: | normal | Keywords: | raw_id_admin many_to_many |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Despite a definition of blank=True, null=True, I've observed fields in 0.95 with raw_id_admin which do not allow said field to be 'empty'.
The issue appears to be related to the fact that the empty is translated in code to ; when the Relation manager attempts to search for these ids, it throws an exception.
The solution to this problem is to detect if it's raw_id_admin, and defined 'empty', and skip the 'add relations' call.
I have attached a patch which solves this problem.
Attachments (3)
Change History (7)
by , 18 years ago
Attachment: | fix_raw_id_admin_m2m.patch added |
---|
comment:3 by , 18 years ago
Summary: | raw_id_admin with ManyToMany does not properly handle 'empty' raw_id_admin fields → [patch] raw_id_admin with ManyToMany does not properly handle 'empty' raw_id_admin fields |
---|
Nevermind; PEBKAC. This patch does correct the stated problem.
by , 18 years ago
Attachment: | fix_raw_id_admin_m2m.2.patch added |
---|
[Version 2: Fixed a bug with original] Updated patch to correct ticket item. Allows for creating initially empty fields, and clearing fields.
by , 18 years ago
Attachment: | fix_raw_id_admin_m2m.zj.patch added |
---|
I prefer this patch, which fixes the html2python method of RawIdAdmin.
comment:4 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fix to skip 'empty' defined raw_id_admin fields and prevent errors