mirror of
https://github.com/django/django.git
synced 2025-10-29 16:46:11 +00:00
Refs #27118 -- Reallowed using pk in QuerySet.get/update_or_create().
This commit is contained in:
committed by
Tim Graham
parent
040bd7c938
commit
1db1f74617
@@ -532,7 +532,8 @@ class QuerySet(object):
|
||||
try:
|
||||
self.model._meta.get_field(param)
|
||||
except exceptions.FieldDoesNotExist:
|
||||
invalid_params.append(param)
|
||||
if param != 'pk': # It's okay to use a model's pk property.
|
||||
invalid_params.append(param)
|
||||
if invalid_params:
|
||||
raise exceptions.FieldError(
|
||||
"Invalid field name(s) for model %s: '%s'." % (
|
||||
|
||||
Reference in New Issue
Block a user