Kaydet (Commit) 1e81e2f5 authored tarafından Joseph Kocherhans's avatar Joseph Kocherhans

Fixed another instance like [12099]. Thanks again, Alex Gaynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12100 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 777da5bc
......@@ -745,9 +745,7 @@ class Model(object):
if not getattr(self, '_adding', False) and self.pk is not None:
qs = qs.exclude(pk=self.pk)
# This cute trick with extra/values is the most efficient way to
# tell if a particular query returns any results.
if qs.extra(select={'a': 1}).values('a').order_by():
if qs.exists():
errors.setdefault(field, []).append(
self.date_error_message(lookup_type, field, unique_for)
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment