server/sources/native.py
branchstable
changeset 9298 eff262f5ec3f
parent 9267 24d9b86dfa54
child 9336 722635e530a0
--- a/server/sources/native.py	Thu Oct 17 10:30:35 2013 +0200
+++ b/server/sources/native.py	Thu Oct 17 16:30:53 2013 +0200
@@ -757,8 +757,10 @@
             if ex.__class__.__name__ == 'IntegrityError':
                 # need string comparison because of various backends
                 for arg in ex.args:
-                    # postgres and sqlserver
-                    mo = re.search('"unique_cw_[^ ]+"', arg)
+                    if 'SQL Server' in arg:
+                        mo = re.search("'unique_cw_[^ ]+'", arg)
+                    else: # postgres
+                        mo = re.search('"unique_cw_[^ ]+"', arg)
                     if mo is not None:
                         index_name = mo.group(0)[1:-1] # eat the surrounding " pair
                         elements = index_name.split('_cw_')[1:]