#1618 closed defect (worksforme)
[patch] Validator for raw_id_admin uses old model API
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | Core (Other) | Version: | magic-removal |
| Severity: | normal | Keywords: | manipulator_valid_rel_key |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Trivial fix:
Index: django/db/models/fields/related.py
===================================================================
--- django/db/models/fields/related.py (revision 263)
+++ django/db/models/fields/related.py (working copy)
@@ -38,7 +38,7 @@
"Validates that the value is a valid foreign key"
klass = f.rel.to
try:
- klass._default_manager.get_object(pk=field_data)
+ klass._default_manager.get(pk=field_data)
except klass.DoesNotExist:
raise validators.ValidationError, _("Please enter a valid %s.") % f.verbose_name
Note:
See TracTickets
for help on using tickets.
I don't actually see this problem in magic-removal head; was it fixed in an earlier commit, perhaps?