Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a regression in validate_unique introduced in [12098]. Thanks, …

…Alex Gaynor.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 777da5bc732348d2182ad0231e89b0cad1a79b5b 1 parent 471596f
@jkocherhans jkocherhans authored
Showing with 1 addition and 3 deletions.
  1. +1 −3 django/db/models/
4 django/db/models/
@@ -715,9 +715,7 @@ def _perform_unique_checks(self, unique_checks):
if not getattr(self, '_adding', False) and is not None:
qs = qs.exclude(
- # 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():
if len(unique_check) == 1:
key = unique_check[0]
Please sign in to comment.
Something went wrong with that request. Please try again.