mirror of
https://github.com/django/django.git
synced 2025-09-27 20:49:21 +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:
parent
c9a96075fa
commit
266c0bb23e
3 changed files with 22 additions and 20 deletions
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue