]> git.openstreetmap.org Git - osqa.git/commitdiff
Make the importer check if triggers can be disabled.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 11 Jun 2010 14:35:38 +0000 (14:35 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 11 Jun 2010 14:35:38 +0000 (14:35 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@408 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum_modules/sximporter/importer.py

index e6f1ce7821bfa001644474a4dfdc834271f943d6..5277b8dd3720fa83bf68650e5d2a8288a11d05b6 100644 (file)
@@ -856,7 +856,11 @@ def reset_sequences():
 
 
 def sximport(dump, options):
-    disable_triggers()
+    try:
+        disable_triggers()
+        triggers_disabled = True
+    except:
+        triggers_disabled = False
     uidmap = userimport(dump, options)
     tagmap = tagsimport(dump, uidmap)
     gc.collect()
@@ -883,7 +887,9 @@ def sximport(dump, options):
     db.commit_transaction()
 
     reset_sequences()
-    enable_triggers()
+
+    if triggers_disabled:
+        enable_triggers()
 
 
 PG_DISABLE_TRIGGERS = """