cubicweb/server/sources/native.py
branch3.26
changeset 12586 afafc8fd9a45
parent 12432 2fcb53ee5178
child 12591 f5f83d72ba8d
child 12726 1a2c7d6397ec
equal deleted inserted replaced
12577:2508ba96fad2 12586:afafc8fd9a45
   693                     cnx.cnxset.rollback()
   693                     cnx.cnxset.rollback()
   694                     if self.repo.config.mode != 'test':
   694                     if self.repo.config.mode != 'test':
   695                         self.debug('transaction has been rolled back')
   695                         self.debug('transaction has been rolled back')
   696                 except Exception:
   696                 except Exception:
   697                     pass
   697                     pass
   698             if ex.__class__.__name__ == 'IntegrityError':
   698             if any(cls.__name__ for cls in ex.__class__.__mro__
       
   699                    if cls.__name__ == 'IntegrityError'):
   699                 # need string comparison because of various backends
   700                 # need string comparison because of various backends
   700                 for arg in ex.args:
   701                 for arg in ex.args:
   701                     # postgres, sqlserver
   702                     # postgres, sqlserver
   702                     mo = re.search("unique_[a-z0-9]{32}", arg)
   703                     mo = re.search("unique_[a-z0-9]{32}", arg)
   703                     if mo is not None:
   704                     if mo is not None: