]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/sximporter/importer.py
Improves the pagination, adds a new sorting method for searches. Fixes some issues...
[osqa.git] / forum_modules / sximporter / importer.py
index d63541c03c64eb86bf92c610d05d542533c66156..2d8c903c1f1125e1a9406b9ff694cacb451acfb7 100644 (file)
@@ -787,12 +787,13 @@ def pages_import(dump, currid):
 
 sx2osqa_set_map = {
 u'theme.html.name': 'APP_TITLE',
-u'theme.html.footer': 'USE_CUSTOM_FOOTER',
+u'theme.html.footer': 'CUSTOM_FOOTER',
 u'theme.html.sidebar': 'SIDEBAR_UPPER_TEXT',
 u'theme.html.sidebar-low': 'SIDEBAR_LOWER_TEXT',
 u'theme.html.welcome': 'APP_INTRO',
 u'theme.html.head': 'CUSTOM_HEAD',
-u'theme.html.header': 'CUSTOM_HEADER'
+u'theme.html.header': 'CUSTOM_HEADER',
+u'theme.css': 'CUSTOM_CSS',
 }
 
 html_codes = (
@@ -853,9 +854,20 @@ def reset_sequences():
         db.execute_many(PG_SEQUENCE_RESETS)
         db.commit_transaction()
 
+def reindex_fts():
+    from south.db import db
+    if db.backend_name == "postgres":
+        db.start_transaction()
+        db.execute_many("UPDATE forum_node_revision set id = id WHERE TRUE;")
+        db.commit_transaction()
+
 
 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()
@@ -882,7 +894,10 @@ def sximport(dump, options):
     db.commit_transaction()
 
     reset_sequences()
-    enable_triggers()
+
+    if triggers_disabled:
+        enable_triggers()
+        reindex_fts()
 
 
 PG_DISABLE_TRIGGERS = """