mirror of
https://github.com/django/django.git
synced 2025-09-10 04:26:30 +00:00
Fixed #14223 -- Extended unification of exception raised in presence of integrity constraint violations.
The unification had been introduced in r12352 and native backend exceptions still slipped through in cases that end in connection.commit() call. Thanks Alex, Jacob and Carl for reviewing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14320 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
cad4feabad
commit
cfdad9ed86
4 changed files with 72 additions and 6 deletions
|
@ -153,6 +153,13 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
|||
cursor.execute("SET client_encoding to 'UNICODE'")
|
||||
return UnicodeCursorWrapper(cursor, 'utf-8')
|
||||
|
||||
def _commit(self):
|
||||
if self.connection is not None:
|
||||
try:
|
||||
return self.connection.commit()
|
||||
except Database.IntegrityError, e:
|
||||
raise utils.IntegrityError, utils.IntegrityError(*tuple(e)), sys.exc_info()[2]
|
||||
|
||||
def typecast_string(s):
|
||||
"""
|
||||
Cast all returned strings to unicode strings.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue