cubicweb/server/sources/native.py
changeset 12591 f5f83d72ba8d
parent 12567 26744ad37953
parent 12586 afafc8fd9a45
child 12614 8ac9ac8d9143
equal deleted inserted replaced
12590:a5d7fcde74c9 12591:f5f83d72ba8d
   688                     cnx.cnxset.rollback()
   688                     cnx.cnxset.rollback()
   689                     if self.repo.config.mode != 'test':
   689                     if self.repo.config.mode != 'test':
   690                         self.debug('transaction has been rolled back')
   690                         self.debug('transaction has been rolled back')
   691                 except Exception:
   691                 except Exception:
   692                     pass
   692                     pass
   693             if ex.__class__.__name__ == 'IntegrityError':
   693             if any(cls.__name__ for cls in ex.__class__.__mro__
       
   694                    if cls.__name__ == 'IntegrityError'):
   694                 # need string comparison because of various backends
   695                 # need string comparison because of various backends
   695                 for arg in ex.args:
   696                 for arg in ex.args:
   696                     # postgres, sqlserver
   697                     # postgres, sqlserver
   697                     mo = re.search("unique_[a-z0-9]{32}", arg)
   698                     mo = re.search("unique_[a-z0-9]{32}", arg)
   698                     if mo is not None:
   699                     if mo is not None: