mirror of
https://github.com/django/django.git
synced 2025-10-30 00:56:09 +00:00
Fixed #20278 -- ensured .get() exceptions do not recurse infinitely
A regression caused by d5b93d3281 made .get() error
reporting recurse infinitely on certain rare conditions. Fixed this by
not trying to print the given lookup kwargs.
This commit is contained in:
@@ -388,13 +388,11 @@ class QuerySet(object):
|
||||
return clone._result_cache[0]
|
||||
if not num:
|
||||
raise self.model.DoesNotExist(
|
||||
"%s matching query does not exist. "
|
||||
"Lookup parameters were %s" %
|
||||
(self.model._meta.object_name, kwargs))
|
||||
"%s matching query does not exist." %
|
||||
self.model._meta.object_name)
|
||||
raise self.model.MultipleObjectsReturned(
|
||||
"get() returned more than one %s -- it returned %s! "
|
||||
"Lookup parameters were %s" %
|
||||
(self.model._meta.object_name, num, kwargs))
|
||||
"get() returned more than one %s -- it returned %s!" %
|
||||
(self.model._meta.object_name, num))
|
||||
|
||||
def create(self, **kwargs):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user