Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1618 closed defect (worksforme)

[patch] Validator for raw_id_admin uses old model API

Reported by: Christopher Lenz <cmlenz@…> Owned by: adrian
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: UI/UX:

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

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by jacob

  • Resolution set to worksforme
  • Status changed from new to closed

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

comment:2 Changed 8 years ago by Christopher Lenz <cmlenz@…>

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.