Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1618 closed defect (worksforme)

[patch] Validator for raw_id_admin uses old model API

Reported by: Christopher Lenz <cmlenz@…> 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

Change History (2)

comment:1 by Jacob, 18 years ago

Resolution: worksforme
Status: newclosed

I don't actually see this problem in magic-removal head; was it fixed in an earlier commit, perhaps?

comment:2 by Christopher Lenz <cmlenz@…>, 18 years ago

Oops, you're right, Adrian fixed that in [2644]. Sorry for the noise.

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