Tweaked the exception message for Django's DoesNotExist messages to make it easier to figure out the situation.
- Legacy-Id: 6316
This commit is contained in:
parent
b335ef3b5c
commit
43fcce48fd
|
@ -343,8 +343,8 @@ class QuerySet(object):
|
||||||
if num == 1:
|
if num == 1:
|
||||||
return clone._result_cache[0]
|
return clone._result_cache[0]
|
||||||
if not num:
|
if not num:
|
||||||
raise self.model.DoesNotExist("%s matching query does not exist."
|
raise self.model.DoesNotExist("%s matching query does not exist. Lookup parameters were %s"
|
||||||
% self.model._meta.object_name)
|
% (self.model._meta.object_name, kwargs))
|
||||||
raise self.model.MultipleObjectsReturned("get() returned more than one %s -- it returned %s! Lookup parameters were %s"
|
raise self.model.MultipleObjectsReturned("get() returned more than one %s -- it returned %s! Lookup parameters were %s"
|
||||||
% (self.model._meta.object_name, num, kwargs))
|
% (self.model._meta.object_name, num, kwargs))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue