equal
deleted
inserted
replaced
755 except Exception as ex: |
755 except Exception as ex: |
756 pass |
756 pass |
757 if ex.__class__.__name__ == 'IntegrityError': |
757 if ex.__class__.__name__ == 'IntegrityError': |
758 # need string comparison because of various backends |
758 # need string comparison because of various backends |
759 for arg in ex.args: |
759 for arg in ex.args: |
760 # postgres and sqlserver |
760 if 'SQL Server' in arg: |
761 mo = re.search('"unique_cw_[^ ]+"', arg) |
761 mo = re.search("'unique_cw_[^ ]+'", arg) |
|
762 else: # postgres |
|
763 mo = re.search('"unique_cw_[^ ]+"', arg) |
762 if mo is not None: |
764 if mo is not None: |
763 index_name = mo.group(0)[1:-1] # eat the surrounding " pair |
765 index_name = mo.group(0)[1:-1] # eat the surrounding " pair |
764 elements = index_name.split('_cw_')[1:] |
766 elements = index_name.split('_cw_')[1:] |
765 etype = elements[0] |
767 etype = elements[0] |
766 rtypes = elements[1:] |
768 rtypes = elements[1:] |